// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]

mod debug;
mod deserialize;
mod serialize;

/// Request message for [DeleteBucket][google.storage.v2.Storage.DeleteBucket].
///
/// [google.storage.v2.Storage.DeleteBucket]: crate::client::StorageControl::delete_bucket
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteBucketRequest {
    /// Required. Name of a bucket to delete.
    pub name: std::string::String,

    /// If set, only deletes the bucket if its metageneration matches this value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// If set, only deletes the bucket if its metageneration does not match this
    /// value.
    pub if_metageneration_not_match: std::option::Option<i64>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteBucketRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteBucketRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::DeleteBucketRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteBucketRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteBucketRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteBucketRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DeleteBucketRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.DeleteBucketRequest"
    }
}

/// Request message for [GetBucket][google.storage.v2.Storage.GetBucket].
///
/// [google.storage.v2.Storage.GetBucket]: crate::client::StorageControl::get_bucket
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetBucketRequest {
    /// Required. Name of a bucket.
    pub name: std::string::String,

    /// If set, only gets the bucket metadata if its metageneration matches this
    /// value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// If set, and if the bucket's current metageneration matches the specified
    /// value, the request returns an error.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// Mask specifying which fields to read.
    /// A `*` field might be used to indicate all fields.
    /// If no mask is specified, it defaults to all fields.
    pub read_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetBucketRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetBucketRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::GetBucketRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::GetBucketRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::GetBucketRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetBucketRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [read_mask][crate::model::GetBucketRequest::read_mask].
    pub fn set_read_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.read_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [read_mask][crate::model::GetBucketRequest::read_mask].
    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.read_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for GetBucketRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.GetBucketRequest"
    }
}

/// Request message for [CreateBucket][google.storage.v2.Storage.CreateBucket].
///
/// [google.storage.v2.Storage.CreateBucket]: crate::client::StorageControl::create_bucket
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBucketRequest {
    /// Required. The project to which this bucket belongs. This field must either
    /// be empty or `projects/_`. The project ID that owns this bucket should be
    /// specified in the `bucket.project` field.
    pub parent: std::string::String,

    /// Optional. Properties of the new bucket being inserted.
    /// The name of the bucket is specified in the `bucket_id` field. Populating
    /// `bucket.name` field results in an error.
    /// The project of the bucket must be specified in the `bucket.project` field.
    /// This field must be in `projects/{projectIdentifier}` format,
    /// {projectIdentifier} can be the project ID or project number. The `parent`
    /// field must be either empty or `projects/_`.
    pub bucket: std::option::Option<crate::model::Bucket>,

    /// Required. The ID to use for this bucket, which becomes the final component
    /// of the bucket's resource name. For example, the value `foo` might result in
    /// a bucket with the name `projects/123456/buckets/foo`.
    pub bucket_id: std::string::String,

    /// Optional. Apply a predefined set of access controls to this bucket.
    /// Valid values are `authenticatedRead`, `private`, `projectPrivate`,
    /// `publicRead`, or `publicReadWrite`.
    pub predefined_acl: std::string::String,

    /// Optional. Apply a predefined set of default object access controls to this
    /// bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
    /// `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
    pub predefined_default_object_acl: std::string::String,

    /// Optional. If true, enable object retention on the bucket.
    pub enable_object_retention: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateBucketRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateBucketRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [bucket][crate::model::CreateBucketRequest::bucket].
    pub fn set_bucket<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Bucket>,
    {
        self.bucket = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [bucket][crate::model::CreateBucketRequest::bucket].
    pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Bucket>,
    {
        self.bucket = v.map(|x| x.into());
        self
    }

    /// Sets the value of [bucket_id][crate::model::CreateBucketRequest::bucket_id].
    pub fn set_bucket_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.bucket_id = v.into();
        self
    }

    /// Sets the value of [predefined_acl][crate::model::CreateBucketRequest::predefined_acl].
    pub fn set_predefined_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.predefined_acl = v.into();
        self
    }

    /// Sets the value of [predefined_default_object_acl][crate::model::CreateBucketRequest::predefined_default_object_acl].
    pub fn set_predefined_default_object_acl<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.predefined_default_object_acl = v.into();
        self
    }

    /// Sets the value of [enable_object_retention][crate::model::CreateBucketRequest::enable_object_retention].
    pub fn set_enable_object_retention<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.enable_object_retention = v.into();
        self
    }
}

impl wkt::message::Message for CreateBucketRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.CreateBucketRequest"
    }
}

/// Request message for [ListBuckets][google.storage.v2.Storage.ListBuckets].
///
/// [google.storage.v2.Storage.ListBuckets]: crate::client::StorageControl::list_buckets
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBucketsRequest {
    /// Required. The project whose buckets we are listing.
    pub parent: std::string::String,

    /// Optional. Maximum number of buckets to return in a single response. The
    /// service uses this parameter or `1,000` items, whichever is smaller. If
    /// `acl` is present in the `read_mask`, the service uses this parameter of
    /// `200` items, whichever is smaller.
    pub page_size: i32,

    /// Optional. A previously-returned page token representing part of the larger
    /// set of results to view.
    pub page_token: std::string::String,

    /// Optional. Filter results to buckets whose names begin with this prefix.
    pub prefix: std::string::String,

    /// Mask specifying which fields to read from each result.
    /// If no mask is specified, it defaults to all fields except `items.
    /// owner`, `items.acl`, and `items.default_object_acl`.
    /// `*` might be used to mean "all fields".
    pub read_mask: std::option::Option<wkt::FieldMask>,

    /// Optional. Allows listing of buckets, even if there are buckets that are
    /// unreachable.
    pub return_partial_success: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListBucketsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListBucketsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListBucketsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListBucketsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [prefix][crate::model::ListBucketsRequest::prefix].
    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.prefix = v.into();
        self
    }

    /// Sets the value of [read_mask][crate::model::ListBucketsRequest::read_mask].
    pub fn set_read_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.read_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [read_mask][crate::model::ListBucketsRequest::read_mask].
    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.read_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [return_partial_success][crate::model::ListBucketsRequest::return_partial_success].
    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.return_partial_success = v.into();
        self
    }
}

impl wkt::message::Message for ListBucketsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.ListBucketsRequest"
    }
}

/// Response message for [ListBuckets][google.storage.v2.Storage.ListBuckets].
///
/// [google.storage.v2.Storage.ListBuckets]: crate::client::StorageControl::list_buckets
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBucketsResponse {
    /// The list of items.
    pub buckets: std::vec::Vec<crate::model::Bucket>,

    /// The continuation token, used to page through large result sets. Provide
    /// this value in a subsequent request to return the next page of results.
    pub next_page_token: std::string::String,

    /// Unreachable resources.
    /// This field can only be present if the caller specified
    /// return_partial_success to be true in the request to receive indications
    /// of temporarily missing resources.
    /// unreachable might be:
    /// unreachable = [
    /// "projects/_/buckets/bucket1",
    /// "projects/_/buckets/bucket2",
    /// "projects/_/buckets/bucket3",
    /// ]
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListBucketsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [buckets][crate::model::ListBucketsResponse::buckets].
    pub fn set_buckets<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Bucket>,
    {
        use std::iter::Iterator;
        self.buckets = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListBucketsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListBucketsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListBucketsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.ListBucketsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListBucketsResponse {
    type PageItem = crate::model::Bucket;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.buckets
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for
/// [LockBucketRetentionPolicy][google.storage.v2.Storage.LockBucketRetentionPolicy].
///
/// [google.storage.v2.Storage.LockBucketRetentionPolicy]: crate::client::StorageControl::lock_bucket_retention_policy
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LockBucketRetentionPolicyRequest {
    /// Required. Name of a bucket.
    pub bucket: std::string::String,

    /// Required. Makes the operation conditional on whether bucket's current
    /// metageneration matches the given value. Must be positive.
    pub if_metageneration_match: i64,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LockBucketRetentionPolicyRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [bucket][crate::model::LockBucketRetentionPolicyRequest::bucket].
    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.bucket = v.into();
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::LockBucketRetentionPolicyRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.if_metageneration_match = v.into();
        self
    }
}

impl wkt::message::Message for LockBucketRetentionPolicyRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.LockBucketRetentionPolicyRequest"
    }
}

/// Request for [UpdateBucket][google.storage.v2.Storage.UpdateBucket] method.
///
/// [google.storage.v2.Storage.UpdateBucket]: crate::client::StorageControl::update_bucket
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateBucketRequest {
    /// Required. The bucket to update.
    /// The bucket's `name` field is used to identify the bucket.
    pub bucket: std::option::Option<crate::model::Bucket>,

    /// If set, the request modifies the bucket if its metageneration matches this
    /// value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// If set, the request modifies the bucket if its metageneration doesn't
    /// match this value.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// Optional. Apply a predefined set of access controls to this bucket.
    /// Valid values are `authenticatedRead`, `private`, `projectPrivate`,
    /// `publicRead`, or `publicReadWrite`.
    pub predefined_acl: std::string::String,

    /// Optional. Apply a predefined set of default object access controls to this
    /// bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
    /// `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
    pub predefined_default_object_acl: std::string::String,

    /// Required. List of fields to be updated.
    ///
    /// To specify ALL fields, equivalent to the JSON API's "update" function,
    /// specify a single field with the value `*`. Note: not recommended. If a new
    /// field is introduced at a later time, an older client updating with the `*`
    /// might accidentally reset the new field's value.
    ///
    /// Not specifying any fields is an error.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateBucketRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [bucket][crate::model::UpdateBucketRequest::bucket].
    pub fn set_bucket<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Bucket>,
    {
        self.bucket = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [bucket][crate::model::UpdateBucketRequest::bucket].
    pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Bucket>,
    {
        self.bucket = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::UpdateBucketRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateBucketRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::UpdateBucketRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateBucketRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [predefined_acl][crate::model::UpdateBucketRequest::predefined_acl].
    pub fn set_predefined_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.predefined_acl = v.into();
        self
    }

    /// Sets the value of [predefined_default_object_acl][crate::model::UpdateBucketRequest::predefined_default_object_acl].
    pub fn set_predefined_default_object_acl<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.predefined_default_object_acl = v.into();
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateBucketRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.UpdateBucketRequest"
    }
}

/// Request message for [ComposeObject][google.storage.v2.Storage.ComposeObject].
///
/// [google.storage.v2.Storage.ComposeObject]: crate::client::StorageControl::compose_object
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ComposeObjectRequest {
    /// Required. Properties of the resulting object.
    pub destination: std::option::Option<crate::model::Object>,

    /// Optional. The list of source objects that is concatenated into a single
    /// object.
    pub source_objects: std::vec::Vec<crate::model::compose_object_request::SourceObject>,

    /// Optional. Apply a predefined set of access controls to the destination
    /// object. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
    /// `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
    pub destination_predefined_acl: std::string::String,

    /// Makes the operation conditional on whether the object's current generation
    /// matches the given value. Setting to 0 makes the operation succeed only if
    /// there are no live versions of the object.
    pub if_generation_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration matches the given value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// Optional. Resource name of the Cloud KMS key, of the form
    /// `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`,
    /// that is used to encrypt the object. Overrides the object
    /// metadata's `kms_key_name` value, if any.
    pub kms_key: std::string::String,

    /// Optional. A set of parameters common to Storage API requests concerning an
    /// object.
    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,

    /// Optional. The checksums of the complete object. This is validated against
    /// the combined checksums of the component objects.
    pub object_checksums: std::option::Option<crate::model::ObjectChecksums>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ComposeObjectRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [destination][crate::model::ComposeObjectRequest::destination].
    pub fn set_destination<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Object>,
    {
        self.destination = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [destination][crate::model::ComposeObjectRequest::destination].
    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Object>,
    {
        self.destination = v.map(|x| x.into());
        self
    }

    /// Sets the value of [source_objects][crate::model::ComposeObjectRequest::source_objects].
    pub fn set_source_objects<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::compose_object_request::SourceObject>,
    {
        use std::iter::Iterator;
        self.source_objects = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [destination_predefined_acl][crate::model::ComposeObjectRequest::destination_predefined_acl].
    pub fn set_destination_predefined_acl<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.destination_predefined_acl = v.into();
        self
    }

    /// Sets the value of [if_generation_match][crate::model::ComposeObjectRequest::if_generation_match].
    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_match][crate::model::ComposeObjectRequest::if_generation_match].
    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::ComposeObjectRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::ComposeObjectRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [kms_key][crate::model::ComposeObjectRequest::kms_key].
    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.kms_key = v.into();
        self
    }

    /// Sets the value of [common_object_request_params][crate::model::ComposeObjectRequest::common_object_request_params].
    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [common_object_request_params][crate::model::ComposeObjectRequest::common_object_request_params].
    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = v.map(|x| x.into());
        self
    }

    /// Sets the value of [object_checksums][crate::model::ComposeObjectRequest::object_checksums].
    pub fn set_object_checksums<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ObjectChecksums>,
    {
        self.object_checksums = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [object_checksums][crate::model::ComposeObjectRequest::object_checksums].
    pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ObjectChecksums>,
    {
        self.object_checksums = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ComposeObjectRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.ComposeObjectRequest"
    }
}

/// Defines additional types related to [ComposeObjectRequest].
pub mod compose_object_request {
    #[allow(unused_imports)]
    use super::*;

    /// Description of a source object for a composition request.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SourceObject {
        /// Required. The source object's name. All source objects must reside in the
        /// same bucket.
        pub name: std::string::String,

        /// Optional. The generation of this object to use as the source.
        pub generation: i64,

        /// Optional. Conditions that must be met for this operation to execute.
        pub object_preconditions: std::option::Option<
            crate::model::compose_object_request::source_object::ObjectPreconditions,
        >,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SourceObject {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [name][crate::model::compose_object_request::SourceObject::name].
        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.name = v.into();
            self
        }

        /// Sets the value of [generation][crate::model::compose_object_request::SourceObject::generation].
        pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.generation = v.into();
            self
        }

        /// Sets the value of [object_preconditions][crate::model::compose_object_request::SourceObject::object_preconditions].
        pub fn set_object_preconditions<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<
                    crate::model::compose_object_request::source_object::ObjectPreconditions,
                >,
        {
            self.object_preconditions = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [object_preconditions][crate::model::compose_object_request::SourceObject::object_preconditions].
        pub fn set_or_clear_object_preconditions<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<
                    crate::model::compose_object_request::source_object::ObjectPreconditions,
                >,
        {
            self.object_preconditions = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for SourceObject {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.ComposeObjectRequest.SourceObject"
        }
    }

    /// Defines additional types related to [SourceObject].
    pub mod source_object {
        #[allow(unused_imports)]
        use super::*;

        /// Preconditions for a source object of a composition request.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct ObjectPreconditions {
            /// Only perform the composition if the generation of the source object
            /// that would be used matches this value.  If this value and a generation
            /// are both specified, they must be the same value or the call fails.
            pub if_generation_match: std::option::Option<i64>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl ObjectPreconditions {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [if_generation_match][crate::model::compose_object_request::source_object::ObjectPreconditions::if_generation_match].
            pub fn set_if_generation_match<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<i64>,
            {
                self.if_generation_match = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [if_generation_match][crate::model::compose_object_request::source_object::ObjectPreconditions::if_generation_match].
            pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<i64>,
            {
                self.if_generation_match = v.map(|x| x.into());
                self
            }
        }

        impl wkt::message::Message for ObjectPreconditions {
            fn typename() -> &'static str {
                "type.googleapis.com/google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions"
            }
        }
    }
}

/// Request message for deleting an object.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteObjectRequest {
    /// Required. Name of the bucket in which the object resides.
    pub bucket: std::string::String,

    /// Required. The name of the finalized object to delete.
    /// Note: If you want to delete an unfinalized resumable upload please use
    /// `CancelResumableWrite`.
    pub object: std::string::String,

    /// Optional. If present, permanently deletes a specific revision of this
    /// object (as opposed to the latest version, the default).
    pub generation: i64,

    /// Makes the operation conditional on whether the object's current generation
    /// matches the given value. Setting to 0 makes the operation succeed only if
    /// there are no live versions of the object.
    pub if_generation_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's live generation
    /// does not match the given value. If no live object exists, the precondition
    /// fails. Setting to 0 makes the operation succeed only if there is a live
    /// version of the object.
    pub if_generation_not_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration matches the given value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration does not match the given value.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// Optional. A set of parameters common to Storage API requests concerning an
    /// object.
    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteObjectRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [bucket][crate::model::DeleteObjectRequest::bucket].
    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.bucket = v.into();
        self
    }

    /// Sets the value of [object][crate::model::DeleteObjectRequest::object].
    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.object = v.into();
        self
    }

    /// Sets the value of [generation][crate::model::DeleteObjectRequest::generation].
    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.generation = v.into();
        self
    }

    /// Sets the value of [if_generation_match][crate::model::DeleteObjectRequest::if_generation_match].
    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_match][crate::model::DeleteObjectRequest::if_generation_match].
    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_generation_not_match][crate::model::DeleteObjectRequest::if_generation_not_match].
    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_not_match][crate::model::DeleteObjectRequest::if_generation_not_match].
    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::DeleteObjectRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteObjectRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteObjectRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteObjectRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [common_object_request_params][crate::model::DeleteObjectRequest::common_object_request_params].
    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [common_object_request_params][crate::model::DeleteObjectRequest::common_object_request_params].
    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DeleteObjectRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.DeleteObjectRequest"
    }
}

/// Request message for
/// [RestoreObject][google.storage.v2.Storage.RestoreObject].
/// `bucket`, `object`, and `generation` **must** be set.
///
/// [google.storage.v2.Storage.RestoreObject]: crate::client::StorageControl::restore_object
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RestoreObjectRequest {
    /// Required. Name of the bucket in which the object resides.
    pub bucket: std::string::String,

    /// Required. The name of the object to restore.
    pub object: std::string::String,

    /// Required. The specific revision of the object to restore.
    pub generation: i64,

    /// Optional. Restore token used to differentiate soft-deleted objects with the
    /// same name and generation. Only applicable for hierarchical namespace
    /// buckets. This parameter is optional, and is only required in the rare case
    /// when there are multiple soft-deleted objects with the same name and
    /// generation.
    pub restore_token: std::string::String,

    /// Makes the operation conditional on whether the object's current generation
    /// matches the given value. Setting to 0 makes the operation succeed only if
    /// there are no live versions of the object.
    pub if_generation_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's live generation
    /// does not match the given value. If no live object exists, the precondition
    /// fails. Setting to 0 makes the operation succeed only if there is a live
    /// version of the object.
    pub if_generation_not_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration matches the given value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration does not match the given value.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// If false or unset, the bucket's default object ACL is used.
    /// If true, copy the source object's access controls.
    /// Return an error if bucket has UBLA enabled.
    pub copy_source_acl: std::option::Option<bool>,

    /// Optional. A set of parameters common to Storage API requests concerning an
    /// object.
    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RestoreObjectRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [bucket][crate::model::RestoreObjectRequest::bucket].
    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.bucket = v.into();
        self
    }

    /// Sets the value of [object][crate::model::RestoreObjectRequest::object].
    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.object = v.into();
        self
    }

    /// Sets the value of [generation][crate::model::RestoreObjectRequest::generation].
    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.generation = v.into();
        self
    }

    /// Sets the value of [restore_token][crate::model::RestoreObjectRequest::restore_token].
    pub fn set_restore_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.restore_token = v.into();
        self
    }

    /// Sets the value of [if_generation_match][crate::model::RestoreObjectRequest::if_generation_match].
    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_match][crate::model::RestoreObjectRequest::if_generation_match].
    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_generation_not_match][crate::model::RestoreObjectRequest::if_generation_not_match].
    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_not_match][crate::model::RestoreObjectRequest::if_generation_not_match].
    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::RestoreObjectRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::RestoreObjectRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::RestoreObjectRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::RestoreObjectRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [copy_source_acl][crate::model::RestoreObjectRequest::copy_source_acl].
    pub fn set_copy_source_acl<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<bool>,
    {
        self.copy_source_acl = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [copy_source_acl][crate::model::RestoreObjectRequest::copy_source_acl].
    pub fn set_or_clear_copy_source_acl<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<bool>,
    {
        self.copy_source_acl = v.map(|x| x.into());
        self
    }

    /// Sets the value of [common_object_request_params][crate::model::RestoreObjectRequest::common_object_request_params].
    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [common_object_request_params][crate::model::RestoreObjectRequest::common_object_request_params].
    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for RestoreObjectRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.RestoreObjectRequest"
    }
}

/// Request message for [ReadObject][google.storage.v2.Storage.ReadObject].
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReadObjectRequest {
    /// Required. The name of the bucket containing the object to read.
    pub bucket: std::string::String,

    /// Required. The name of the object to read.
    pub object: std::string::String,

    /// Optional. If present, selects a specific revision of this object (as
    /// opposed to the latest version, the default).
    pub generation: i64,

    /// Optional. The offset for the first byte to return in the read, relative to
    /// the start of the object.
    ///
    /// A negative `read_offset` value is interpreted as the number of bytes
    /// back from the end of the object to be returned. For example, if an object's
    /// length is `15` bytes, a `ReadObjectRequest` with `read_offset` = `-5` and
    /// `read_limit` = `3` would return bytes `10` through `12` of the object.
    /// Requesting a negative offset with magnitude larger than the size of the
    /// object returns the entire object.
    pub read_offset: i64,

    /// Optional. The maximum number of `data` bytes the server is allowed to
    /// return in the sum of all `Object` messages. A `read_limit` of zero
    /// indicates that there is no limit, and a negative `read_limit` causes an
    /// error.
    ///
    /// If the stream returns fewer bytes than allowed by the `read_limit` and no
    /// error occurred, the stream includes all data from the `read_offset` to the
    /// end of the resource.
    pub read_limit: i64,

    /// Makes the operation conditional on whether the object's current generation
    /// matches the given value. Setting to 0 makes the operation succeed only if
    /// there are no live versions of the object.
    pub if_generation_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's live generation
    /// does not match the given value. If no live object exists, the precondition
    /// fails. Setting to 0 makes the operation succeed only if there is a live
    /// version of the object.
    pub if_generation_not_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration matches the given value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration does not match the given value.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// Optional. A set of parameters common to Storage API requests concerning an
    /// object.
    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,

    /// Mask specifying which fields to read.
    /// The `checksummed_data` field and its children are always present.
    /// If no mask is specified, it defaults to all fields except `metadata.
    /// owner` and `metadata.acl`.
    /// `*` might be used to mean "all fields".
    pub read_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ReadObjectRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [bucket][crate::model::ReadObjectRequest::bucket].
    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.bucket = v.into();
        self
    }

    /// Sets the value of [object][crate::model::ReadObjectRequest::object].
    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.object = v.into();
        self
    }

    /// Sets the value of [generation][crate::model::ReadObjectRequest::generation].
    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.generation = v.into();
        self
    }

    /// Sets the value of [read_offset][crate::model::ReadObjectRequest::read_offset].
    pub fn set_read_offset<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.read_offset = v.into();
        self
    }

    /// Sets the value of [read_limit][crate::model::ReadObjectRequest::read_limit].
    pub fn set_read_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.read_limit = v.into();
        self
    }

    /// Sets the value of [if_generation_match][crate::model::ReadObjectRequest::if_generation_match].
    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_match][crate::model::ReadObjectRequest::if_generation_match].
    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_generation_not_match][crate::model::ReadObjectRequest::if_generation_not_match].
    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_not_match][crate::model::ReadObjectRequest::if_generation_not_match].
    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::ReadObjectRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::ReadObjectRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::ReadObjectRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::ReadObjectRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [common_object_request_params][crate::model::ReadObjectRequest::common_object_request_params].
    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [common_object_request_params][crate::model::ReadObjectRequest::common_object_request_params].
    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = v.map(|x| x.into());
        self
    }

    /// Sets the value of [read_mask][crate::model::ReadObjectRequest::read_mask].
    pub fn set_read_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.read_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [read_mask][crate::model::ReadObjectRequest::read_mask].
    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.read_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ReadObjectRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.ReadObjectRequest"
    }
}

/// Request message for [GetObject][google.storage.v2.Storage.GetObject].
///
/// [google.storage.v2.Storage.GetObject]: crate::client::StorageControl::get_object
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetObjectRequest {
    /// Required. Name of the bucket in which the object resides.
    pub bucket: std::string::String,

    /// Required. Name of the object.
    pub object: std::string::String,

    /// Optional. If present, selects a specific revision of this object (as
    /// opposed to the latest version, the default).
    pub generation: i64,

    /// If true, return the soft-deleted version of this object.
    pub soft_deleted: std::option::Option<bool>,

    /// Makes the operation conditional on whether the object's current generation
    /// matches the given value. Setting to 0 makes the operation succeed only if
    /// there are no live versions of the object.
    pub if_generation_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's live generation
    /// does not match the given value. If no live object exists, the precondition
    /// fails. Setting to 0 makes the operation succeed only if there is a live
    /// version of the object.
    pub if_generation_not_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration matches the given value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration does not match the given value.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// Optional. A set of parameters common to Storage API requests concerning an
    /// object.
    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,

    /// Mask specifying which fields to read.
    /// If no mask is specified, it defaults to all fields except `metadata.
    /// acl` and `metadata.owner`.
    /// `*` might be used to mean "all fields".
    pub read_mask: std::option::Option<wkt::FieldMask>,

    /// Optional. Restore token used to differentiate soft-deleted objects with the
    /// same name and generation. Only applicable for hierarchical namespace
    /// buckets and if `soft_deleted` is set to `true`. This parameter is optional,
    /// and is only required in the rare case when there are multiple soft-deleted
    /// objects with the same `name` and `generation`.
    pub restore_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetObjectRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [bucket][crate::model::GetObjectRequest::bucket].
    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.bucket = v.into();
        self
    }

    /// Sets the value of [object][crate::model::GetObjectRequest::object].
    pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.object = v.into();
        self
    }

    /// Sets the value of [generation][crate::model::GetObjectRequest::generation].
    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.generation = v.into();
        self
    }

    /// Sets the value of [soft_deleted][crate::model::GetObjectRequest::soft_deleted].
    pub fn set_soft_deleted<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<bool>,
    {
        self.soft_deleted = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [soft_deleted][crate::model::GetObjectRequest::soft_deleted].
    pub fn set_or_clear_soft_deleted<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<bool>,
    {
        self.soft_deleted = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_generation_match][crate::model::GetObjectRequest::if_generation_match].
    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_match][crate::model::GetObjectRequest::if_generation_match].
    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_generation_not_match][crate::model::GetObjectRequest::if_generation_not_match].
    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_not_match][crate::model::GetObjectRequest::if_generation_not_match].
    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::GetObjectRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::GetObjectRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::GetObjectRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetObjectRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [common_object_request_params][crate::model::GetObjectRequest::common_object_request_params].
    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [common_object_request_params][crate::model::GetObjectRequest::common_object_request_params].
    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = v.map(|x| x.into());
        self
    }

    /// Sets the value of [read_mask][crate::model::GetObjectRequest::read_mask].
    pub fn set_read_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.read_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [read_mask][crate::model::GetObjectRequest::read_mask].
    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.read_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [restore_token][crate::model::GetObjectRequest::restore_token].
    pub fn set_restore_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.restore_token = v.into();
        self
    }
}

impl wkt::message::Message for GetObjectRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.GetObjectRequest"
    }
}

/// Describes an attempt to insert an object, possibly over multiple requests.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WriteObjectSpec {
    /// Required. Destination object, including its name and its metadata.
    pub resource: std::option::Option<crate::model::Object>,

    /// Optional. Apply a predefined set of access controls to this object.
    /// Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
    /// `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
    pub predefined_acl: std::string::String,

    /// Makes the operation conditional on whether the object's current
    /// generation matches the given value. Setting to `0` makes the operation
    /// succeed only if there are no live versions of the object.
    pub if_generation_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's live
    /// generation does not match the given value. If no live object exists, the
    /// precondition fails. Setting to `0` makes the operation succeed only if
    /// there is a live version of the object.
    pub if_generation_not_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration matches the given value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration does not match the given value.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// The expected final object size being uploaded.
    /// If this value is set, closing the stream after writing fewer or more than
    /// `object_size` bytes results in an `OUT_OF_RANGE` error.
    ///
    /// This situation is considered a client error, and if such an error occurs
    /// you must start the upload over from scratch, this time sending the correct
    /// number of bytes.
    pub object_size: std::option::Option<i64>,

    /// If `true`, the object is created in appendable mode.
    /// This field might only be set when using `BidiWriteObject`.
    pub appendable: std::option::Option<bool>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl WriteObjectSpec {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [resource][crate::model::WriteObjectSpec::resource].
    pub fn set_resource<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Object>,
    {
        self.resource = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [resource][crate::model::WriteObjectSpec::resource].
    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Object>,
    {
        self.resource = v.map(|x| x.into());
        self
    }

    /// Sets the value of [predefined_acl][crate::model::WriteObjectSpec::predefined_acl].
    pub fn set_predefined_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.predefined_acl = v.into();
        self
    }

    /// Sets the value of [if_generation_match][crate::model::WriteObjectSpec::if_generation_match].
    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_match][crate::model::WriteObjectSpec::if_generation_match].
    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_generation_not_match][crate::model::WriteObjectSpec::if_generation_not_match].
    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_not_match][crate::model::WriteObjectSpec::if_generation_not_match].
    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::WriteObjectSpec::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::WriteObjectSpec::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::WriteObjectSpec::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::WriteObjectSpec::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [object_size][crate::model::WriteObjectSpec::object_size].
    pub fn set_object_size<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.object_size = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [object_size][crate::model::WriteObjectSpec::object_size].
    pub fn set_or_clear_object_size<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.object_size = v.map(|x| x.into());
        self
    }

    /// Sets the value of [appendable][crate::model::WriteObjectSpec::appendable].
    pub fn set_appendable<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<bool>,
    {
        self.appendable = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [appendable][crate::model::WriteObjectSpec::appendable].
    pub fn set_or_clear_appendable<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<bool>,
    {
        self.appendable = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for WriteObjectSpec {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.WriteObjectSpec"
    }
}

/// Request message for [ListObjects][google.storage.v2.Storage.ListObjects].
///
/// [google.storage.v2.Storage.ListObjects]: crate::client::StorageControl::list_objects
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListObjectsRequest {
    /// Required. Name of the bucket in which to look for objects.
    pub parent: std::string::String,

    /// Optional. Maximum number of `items` plus `prefixes` to return
    /// in a single page of responses. As duplicate `prefixes` are
    /// omitted, fewer total results might be returned than requested. The service
    /// uses this parameter or 1,000 items, whichever is smaller.
    pub page_size: i32,

    /// Optional. A previously-returned page token representing part of the larger
    /// set of results to view.
    pub page_token: std::string::String,

    /// Optional. If set, returns results in a directory-like mode. `items`
    /// contains only objects whose names, aside from the `prefix`, do not contain
    /// `delimiter`. Objects whose names, aside from the `prefix`, contain
    /// `delimiter` has their name, truncated after the `delimiter`, returned in
    /// `prefixes`. Duplicate `prefixes` are omitted.
    pub delimiter: std::string::String,

    /// Optional. If true, objects that end in exactly one instance of `delimiter`
    /// has their metadata included in `items` in addition to
    /// `prefixes`.
    pub include_trailing_delimiter: bool,

    /// Optional. Filter results to objects whose names begin with this prefix.
    pub prefix: std::string::String,

    /// Optional. If `true`, lists all versions of an object as distinct results.
    pub versions: bool,

    /// Mask specifying which fields to read from each result.
    /// If no mask is specified, defaults to all fields except `items.acl` and
    /// `items.owner`.
    /// `*` might be used to mean all fields.
    pub read_mask: std::option::Option<wkt::FieldMask>,

    /// Optional. Filter results to objects whose names are lexicographically equal
    /// to or after `lexicographic_start`. If `lexicographic_end` is also set, the
    /// objects listed have names between `lexicographic_start` (inclusive) and
    /// `lexicographic_end` (exclusive).
    pub lexicographic_start: std::string::String,

    /// Optional. Filter results to objects whose names are lexicographically
    /// before `lexicographic_end`. If `lexicographic_start` is also set, the
    /// objects listed have names between `lexicographic_start` (inclusive) and
    /// `lexicographic_end` (exclusive).
    pub lexicographic_end: std::string::String,

    /// Optional. If true, only list all soft-deleted versions of the object.
    /// Soft delete policy is required to set this option.
    pub soft_deleted: bool,

    /// Optional. If true, includes folders and managed folders (besides objects)
    /// in the returned `prefixes`. Requires `delimiter` to be set to '/'.
    pub include_folders_as_prefixes: bool,

    /// Optional. Filter results to objects and prefixes that match this glob
    /// pattern. See [List objects using
    /// glob](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob)
    /// for the full syntax.
    pub match_glob: std::string::String,

    /// Optional. An expression used to filter the returned objects by the
    /// `context` field. For the full syntax, see [Filter objects by contexts
    /// syntax](https://cloud.google.com/storage/docs/listing-objects#filter-by-object-contexts-syntax).
    /// If a `delimiter` is set, the returned `prefixes` are exempt from this
    /// filter.
    pub filter: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListObjectsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListObjectsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListObjectsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListObjectsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [delimiter][crate::model::ListObjectsRequest::delimiter].
    pub fn set_delimiter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.delimiter = v.into();
        self
    }

    /// Sets the value of [include_trailing_delimiter][crate::model::ListObjectsRequest::include_trailing_delimiter].
    pub fn set_include_trailing_delimiter<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.include_trailing_delimiter = v.into();
        self
    }

    /// Sets the value of [prefix][crate::model::ListObjectsRequest::prefix].
    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.prefix = v.into();
        self
    }

    /// Sets the value of [versions][crate::model::ListObjectsRequest::versions].
    pub fn set_versions<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.versions = v.into();
        self
    }

    /// Sets the value of [read_mask][crate::model::ListObjectsRequest::read_mask].
    pub fn set_read_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.read_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [read_mask][crate::model::ListObjectsRequest::read_mask].
    pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.read_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [lexicographic_start][crate::model::ListObjectsRequest::lexicographic_start].
    pub fn set_lexicographic_start<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.lexicographic_start = v.into();
        self
    }

    /// Sets the value of [lexicographic_end][crate::model::ListObjectsRequest::lexicographic_end].
    pub fn set_lexicographic_end<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.lexicographic_end = v.into();
        self
    }

    /// Sets the value of [soft_deleted][crate::model::ListObjectsRequest::soft_deleted].
    pub fn set_soft_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.soft_deleted = v.into();
        self
    }

    /// Sets the value of [include_folders_as_prefixes][crate::model::ListObjectsRequest::include_folders_as_prefixes].
    pub fn set_include_folders_as_prefixes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.include_folders_as_prefixes = v.into();
        self
    }

    /// Sets the value of [match_glob][crate::model::ListObjectsRequest::match_glob].
    pub fn set_match_glob<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.match_glob = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListObjectsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }
}

impl wkt::message::Message for ListObjectsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.ListObjectsRequest"
    }
}

/// Request message for [RewriteObject][google.storage.v2.Storage.RewriteObject].
/// If the source object is encrypted using a Customer-Supplied Encryption Key
/// the key information must be provided in the
/// `copy_source_encryption_algorithm`, `copy_source_encryption_key_bytes`, and
/// `copy_source_encryption_key_sha256_bytes` fields. If the destination object
/// should be encrypted the keying information should be provided in the
/// `encryption_algorithm`, `encryption_key_bytes`, and
/// `encryption_key_sha256_bytes` fields of the
/// `common_object_request_params.customer_encryption` field.
///
/// [google.storage.v2.Storage.RewriteObject]: crate::client::StorageControl::rewrite_object
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RewriteObjectRequest {
    /// Required. Immutable. The name of the destination object.
    /// See the
    /// [Naming Guidelines](https://cloud.google.com/storage/docs/objects#naming).
    /// Example: `test.txt`
    /// The `name` field by itself does not uniquely identify a Cloud Storage
    /// object. A Cloud Storage object is uniquely identified by the tuple of
    /// (bucket, object, generation).
    pub destination_name: std::string::String,

    /// Required. Immutable. The name of the bucket containing the destination
    /// object.
    pub destination_bucket: std::string::String,

    /// Optional. The name of the Cloud KMS key that is used to encrypt the
    /// destination object. The Cloud KMS key must be located in same location as
    /// the object. If the parameter is not specified, the request uses the
    /// destination bucket's default encryption key, if any, or else the
    /// Google-managed encryption key.
    pub destination_kms_key: std::string::String,

    /// Optional. Properties of the destination, post-rewrite object.
    /// The `name`, `bucket` and `kms_key` fields must not be populated (these
    /// values are specified in the `destination_name`, `destination_bucket`, and
    /// `destination_kms_key` fields).
    /// If `destination` is present it is used to construct the destination
    /// object's metadata; otherwise the destination object's metadata is
    /// copied from the source object.
    pub destination: std::option::Option<crate::model::Object>,

    /// Required. Name of the bucket in which to find the source object.
    pub source_bucket: std::string::String,

    /// Required. Name of the source object.
    pub source_object: std::string::String,

    /// Optional. If present, selects a specific revision of the source object (as
    /// opposed to the latest version, the default).
    pub source_generation: i64,

    /// Optional. Include this field (from the previous rewrite response) on each
    /// rewrite request after the first one, until the rewrite response 'done' flag
    /// is true. Calls that provide a rewriteToken can omit all other request
    /// fields, but if included those fields must match the values provided in the
    /// first rewrite request.
    pub rewrite_token: std::string::String,

    /// Optional. Apply a predefined set of access controls to the destination
    /// object. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
    /// `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
    pub destination_predefined_acl: std::string::String,

    /// Makes the operation conditional on whether the object's current generation
    /// matches the given value. Setting to 0 makes the operation succeed only if
    /// there are no live versions of the object.
    pub if_generation_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's live generation
    /// does not match the given value. If no live object exists, the precondition
    /// fails. Setting to 0 makes the operation succeed only if there is a live
    /// version of the object.
    pub if_generation_not_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the destination object's current
    /// metageneration matches the given value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the destination object's current
    /// metageneration does not match the given value.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the source object's live
    /// generation matches the given value.
    pub if_source_generation_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the source object's live
    /// generation does not match the given value.
    pub if_source_generation_not_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the source object's current
    /// metageneration matches the given value.
    pub if_source_metageneration_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the source object's current
    /// metageneration does not match the given value.
    pub if_source_metageneration_not_match: std::option::Option<i64>,

    /// Optional. The maximum number of bytes that are rewritten per rewrite
    /// request. Most callers shouldn't need to specify this parameter - it is
    /// primarily in place to support testing. If specified the value must be an
    /// integral multiple of 1 MiB (1048576). Also, this only applies to requests
    /// where the source and destination span locations and/or storage classes.
    /// Finally, this value must not change across rewrite calls else you'll get an
    /// error that the `rewriteToken` is invalid.
    pub max_bytes_rewritten_per_call: i64,

    /// Optional. The algorithm used to encrypt the source object, if any. Used if
    /// the source object was encrypted with a Customer-Supplied Encryption Key.
    pub copy_source_encryption_algorithm: std::string::String,

    /// Optional. The raw bytes (not base64-encoded) AES-256 encryption key used to
    /// encrypt the source object, if it was encrypted with a Customer-Supplied
    /// Encryption Key.
    pub copy_source_encryption_key_bytes: ::bytes::Bytes,

    /// Optional. The raw bytes (not base64-encoded) SHA256 hash of the encryption
    /// key used to encrypt the source object, if it was encrypted with a
    /// Customer-Supplied Encryption Key.
    pub copy_source_encryption_key_sha256_bytes: ::bytes::Bytes,

    /// Optional. A set of parameters common to Storage API requests concerning an
    /// object.
    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,

    /// Optional. The checksums of the complete object. This is used to validate
    /// the destination object after rewriting.
    pub object_checksums: std::option::Option<crate::model::ObjectChecksums>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RewriteObjectRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [destination_name][crate::model::RewriteObjectRequest::destination_name].
    pub fn set_destination_name<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.destination_name = v.into();
        self
    }

    /// Sets the value of [destination_bucket][crate::model::RewriteObjectRequest::destination_bucket].
    pub fn set_destination_bucket<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.destination_bucket = v.into();
        self
    }

    /// Sets the value of [destination_kms_key][crate::model::RewriteObjectRequest::destination_kms_key].
    pub fn set_destination_kms_key<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.destination_kms_key = v.into();
        self
    }

    /// Sets the value of [destination][crate::model::RewriteObjectRequest::destination].
    pub fn set_destination<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Object>,
    {
        self.destination = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [destination][crate::model::RewriteObjectRequest::destination].
    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Object>,
    {
        self.destination = v.map(|x| x.into());
        self
    }

    /// Sets the value of [source_bucket][crate::model::RewriteObjectRequest::source_bucket].
    pub fn set_source_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.source_bucket = v.into();
        self
    }

    /// Sets the value of [source_object][crate::model::RewriteObjectRequest::source_object].
    pub fn set_source_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.source_object = v.into();
        self
    }

    /// Sets the value of [source_generation][crate::model::RewriteObjectRequest::source_generation].
    pub fn set_source_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.source_generation = v.into();
        self
    }

    /// Sets the value of [rewrite_token][crate::model::RewriteObjectRequest::rewrite_token].
    pub fn set_rewrite_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.rewrite_token = v.into();
        self
    }

    /// Sets the value of [destination_predefined_acl][crate::model::RewriteObjectRequest::destination_predefined_acl].
    pub fn set_destination_predefined_acl<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.destination_predefined_acl = v.into();
        self
    }

    /// Sets the value of [if_generation_match][crate::model::RewriteObjectRequest::if_generation_match].
    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_match][crate::model::RewriteObjectRequest::if_generation_match].
    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_generation_not_match][crate::model::RewriteObjectRequest::if_generation_not_match].
    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_not_match][crate::model::RewriteObjectRequest::if_generation_not_match].
    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::RewriteObjectRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::RewriteObjectRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::RewriteObjectRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::RewriteObjectRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_source_generation_match][crate::model::RewriteObjectRequest::if_source_generation_match].
    pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_generation_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_source_generation_match][crate::model::RewriteObjectRequest::if_source_generation_match].
    pub fn set_or_clear_if_source_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_generation_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_source_generation_not_match][crate::model::RewriteObjectRequest::if_source_generation_not_match].
    pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_generation_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_source_generation_not_match][crate::model::RewriteObjectRequest::if_source_generation_not_match].
    pub fn set_or_clear_if_source_generation_not_match<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_generation_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_source_metageneration_match][crate::model::RewriteObjectRequest::if_source_metageneration_match].
    pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_source_metageneration_match][crate::model::RewriteObjectRequest::if_source_metageneration_match].
    pub fn set_or_clear_if_source_metageneration_match<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_source_metageneration_not_match][crate::model::RewriteObjectRequest::if_source_metageneration_not_match].
    pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_source_metageneration_not_match][crate::model::RewriteObjectRequest::if_source_metageneration_not_match].
    pub fn set_or_clear_if_source_metageneration_not_match<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [max_bytes_rewritten_per_call][crate::model::RewriteObjectRequest::max_bytes_rewritten_per_call].
    pub fn set_max_bytes_rewritten_per_call<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.max_bytes_rewritten_per_call = v.into();
        self
    }

    /// Sets the value of [copy_source_encryption_algorithm][crate::model::RewriteObjectRequest::copy_source_encryption_algorithm].
    pub fn set_copy_source_encryption_algorithm<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.copy_source_encryption_algorithm = v.into();
        self
    }

    /// Sets the value of [copy_source_encryption_key_bytes][crate::model::RewriteObjectRequest::copy_source_encryption_key_bytes].
    pub fn set_copy_source_encryption_key_bytes<T: std::convert::Into<::bytes::Bytes>>(
        mut self,
        v: T,
    ) -> Self {
        self.copy_source_encryption_key_bytes = v.into();
        self
    }

    /// Sets the value of [copy_source_encryption_key_sha256_bytes][crate::model::RewriteObjectRequest::copy_source_encryption_key_sha256_bytes].
    pub fn set_copy_source_encryption_key_sha256_bytes<T: std::convert::Into<::bytes::Bytes>>(
        mut self,
        v: T,
    ) -> Self {
        self.copy_source_encryption_key_sha256_bytes = v.into();
        self
    }

    /// Sets the value of [common_object_request_params][crate::model::RewriteObjectRequest::common_object_request_params].
    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [common_object_request_params][crate::model::RewriteObjectRequest::common_object_request_params].
    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = v.map(|x| x.into());
        self
    }

    /// Sets the value of [object_checksums][crate::model::RewriteObjectRequest::object_checksums].
    pub fn set_object_checksums<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ObjectChecksums>,
    {
        self.object_checksums = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [object_checksums][crate::model::RewriteObjectRequest::object_checksums].
    pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ObjectChecksums>,
    {
        self.object_checksums = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for RewriteObjectRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.RewriteObjectRequest"
    }
}

/// A rewrite response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RewriteResponse {
    /// The total bytes written so far, which can be used to provide a waiting user
    /// with a progress indicator. This property is always present in the response.
    pub total_bytes_rewritten: i64,

    /// The total size of the object being copied in bytes. This property is always
    /// present in the response.
    pub object_size: i64,

    /// `true` if the copy is finished; otherwise, `false` if
    /// the copy is in progress. This property is always present in the response.
    pub done: bool,

    /// A token to use in subsequent requests to continue copying data. This token
    /// is present in the response only when there is more data to copy.
    pub rewrite_token: std::string::String,

    /// A resource containing the metadata for the copied-to object. This property
    /// is present in the response only when copying completes.
    pub resource: std::option::Option<crate::model::Object>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RewriteResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [total_bytes_rewritten][crate::model::RewriteResponse::total_bytes_rewritten].
    pub fn set_total_bytes_rewritten<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.total_bytes_rewritten = v.into();
        self
    }

    /// Sets the value of [object_size][crate::model::RewriteResponse::object_size].
    pub fn set_object_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.object_size = v.into();
        self
    }

    /// Sets the value of [done][crate::model::RewriteResponse::done].
    pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.done = v.into();
        self
    }

    /// Sets the value of [rewrite_token][crate::model::RewriteResponse::rewrite_token].
    pub fn set_rewrite_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.rewrite_token = v.into();
        self
    }

    /// Sets the value of [resource][crate::model::RewriteResponse::resource].
    pub fn set_resource<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Object>,
    {
        self.resource = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [resource][crate::model::RewriteResponse::resource].
    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Object>,
    {
        self.resource = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for RewriteResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.RewriteResponse"
    }
}

/// Request message for [MoveObject][google.storage.v2.Storage.MoveObject].
///
/// [google.storage.v2.Storage.MoveObject]: crate::client::StorageControl::move_object
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveObjectRequest {
    /// Required. Name of the bucket in which the object resides.
    pub bucket: std::string::String,

    /// Required. Name of the source object.
    pub source_object: std::string::String,

    /// Required. Name of the destination object.
    pub destination_object: std::string::String,

    /// Optional. Makes the operation conditional on whether the source object's
    /// current generation matches the given value. `if_source_generation_match`
    /// and `if_source_generation_not_match` conditions are mutually exclusive:
    /// it's an error for both of them to be set in the request.
    pub if_source_generation_match: std::option::Option<i64>,

    /// Optional. Makes the operation conditional on whether the source object's
    /// current generation does not match the given value.
    /// `if_source_generation_match` and `if_source_generation_not_match`
    /// conditions are mutually exclusive: it's an error for both of them to be set
    /// in the request.
    pub if_source_generation_not_match: std::option::Option<i64>,

    /// Optional. Makes the operation conditional on whether the source object's
    /// current metageneration matches the given value.
    /// `if_source_metageneration_match` and `if_source_metageneration_not_match`
    /// conditions are mutually exclusive: it's an error for both of them to be set
    /// in the request.
    pub if_source_metageneration_match: std::option::Option<i64>,

    /// Optional. Makes the operation conditional on whether the source object's
    /// current metageneration does not match the given value.
    /// `if_source_metageneration_match` and `if_source_metageneration_not_match`
    /// conditions are mutually exclusive: it's an error for both of them to be set
    /// in the request.
    pub if_source_metageneration_not_match: std::option::Option<i64>,

    /// Optional. Makes the operation conditional on whether the destination
    /// object's current generation matches the given value. Setting to 0 makes the
    /// operation succeed only if there are no live versions of the object.
    /// `if_generation_match` and `if_generation_not_match` conditions are mutually
    /// exclusive: it's an error for both of them to be set in the request.
    pub if_generation_match: std::option::Option<i64>,

    /// Optional. Makes the operation conditional on whether the destination
    /// object's current generation does not match the given value. If no live
    /// object exists, the precondition fails. Setting to 0 makes the operation
    /// succeed only if there is a live version of the object.
    /// `if_generation_match` and `if_generation_not_match` conditions are mutually
    /// exclusive: it's an error for both of them to be set in the request.
    pub if_generation_not_match: std::option::Option<i64>,

    /// Optional. Makes the operation conditional on whether the destination
    /// object's current metageneration matches the given value.
    /// `if_metageneration_match` and `if_metageneration_not_match` conditions are
    /// mutually exclusive: it's an error for both of them to be set in the
    /// request.
    pub if_metageneration_match: std::option::Option<i64>,

    /// Optional. Makes the operation conditional on whether the destination
    /// object's current metageneration does not match the given value.
    /// `if_metageneration_match` and `if_metageneration_not_match` conditions are
    /// mutually exclusive: it's an error for both of them to be set in the
    /// request.
    pub if_metageneration_not_match: std::option::Option<i64>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MoveObjectRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [bucket][crate::model::MoveObjectRequest::bucket].
    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.bucket = v.into();
        self
    }

    /// Sets the value of [source_object][crate::model::MoveObjectRequest::source_object].
    pub fn set_source_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.source_object = v.into();
        self
    }

    /// Sets the value of [destination_object][crate::model::MoveObjectRequest::destination_object].
    pub fn set_destination_object<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.destination_object = v.into();
        self
    }

    /// Sets the value of [if_source_generation_match][crate::model::MoveObjectRequest::if_source_generation_match].
    pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_generation_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_source_generation_match][crate::model::MoveObjectRequest::if_source_generation_match].
    pub fn set_or_clear_if_source_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_generation_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_source_generation_not_match][crate::model::MoveObjectRequest::if_source_generation_not_match].
    pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_generation_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_source_generation_not_match][crate::model::MoveObjectRequest::if_source_generation_not_match].
    pub fn set_or_clear_if_source_generation_not_match<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_generation_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_source_metageneration_match][crate::model::MoveObjectRequest::if_source_metageneration_match].
    pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_source_metageneration_match][crate::model::MoveObjectRequest::if_source_metageneration_match].
    pub fn set_or_clear_if_source_metageneration_match<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_source_metageneration_not_match][crate::model::MoveObjectRequest::if_source_metageneration_not_match].
    pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_source_metageneration_not_match][crate::model::MoveObjectRequest::if_source_metageneration_not_match].
    pub fn set_or_clear_if_source_metageneration_not_match<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_source_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_generation_match][crate::model::MoveObjectRequest::if_generation_match].
    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_match][crate::model::MoveObjectRequest::if_generation_match].
    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_generation_not_match][crate::model::MoveObjectRequest::if_generation_not_match].
    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_not_match][crate::model::MoveObjectRequest::if_generation_not_match].
    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::MoveObjectRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::MoveObjectRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::MoveObjectRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::MoveObjectRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for MoveObjectRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.MoveObjectRequest"
    }
}

/// Request message for [UpdateObject][google.storage.v2.Storage.UpdateObject].
///
/// [google.storage.v2.Storage.UpdateObject]: crate::client::StorageControl::update_object
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateObjectRequest {
    /// Required. The object to update.
    /// The object's bucket and name fields are used to identify the object to
    /// update. If present, the object's generation field selects a specific
    /// revision of this object whose metadata should be updated. Otherwise,
    /// assumes the live version of the object.
    pub object: std::option::Option<crate::model::Object>,

    /// Makes the operation conditional on whether the object's current generation
    /// matches the given value. Setting to 0 makes the operation succeed only if
    /// there are no live versions of the object.
    pub if_generation_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's live generation
    /// does not match the given value. If no live object exists, the precondition
    /// fails. Setting to 0 makes the operation succeed only if there is a live
    /// version of the object.
    pub if_generation_not_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration matches the given value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// Makes the operation conditional on whether the object's current
    /// metageneration does not match the given value.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// Optional. Apply a predefined set of access controls to this object.
    /// Valid values are "authenticatedRead", "bucketOwnerFullControl",
    /// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
    pub predefined_acl: std::string::String,

    /// Required. List of fields to be updated.
    ///
    /// To specify ALL fields, equivalent to the JSON API's "update" function,
    /// specify a single field with the value `*`. Note: not recommended. If a new
    /// field is introduced at a later time, an older client updating with the `*`
    /// might accidentally reset the new field's value.
    ///
    /// Not specifying any fields is an error.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Optional. A set of parameters common to Storage API requests concerning an
    /// object.
    pub common_object_request_params: std::option::Option<crate::model::CommonObjectRequestParams>,

    /// Optional. Overrides the unlocked retention config on the object.
    pub override_unlocked_retention: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateObjectRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [object][crate::model::UpdateObjectRequest::object].
    pub fn set_object<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Object>,
    {
        self.object = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [object][crate::model::UpdateObjectRequest::object].
    pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Object>,
    {
        self.object = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_generation_match][crate::model::UpdateObjectRequest::if_generation_match].
    pub fn set_if_generation_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_match][crate::model::UpdateObjectRequest::if_generation_match].
    pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_generation_not_match][crate::model::UpdateObjectRequest::if_generation_not_match].
    pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_generation_not_match][crate::model::UpdateObjectRequest::if_generation_not_match].
    pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_generation_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::UpdateObjectRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateObjectRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::UpdateObjectRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateObjectRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [predefined_acl][crate::model::UpdateObjectRequest::predefined_acl].
    pub fn set_predefined_acl<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.predefined_acl = v.into();
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateObjectRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateObjectRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [common_object_request_params][crate::model::UpdateObjectRequest::common_object_request_params].
    pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [common_object_request_params][crate::model::UpdateObjectRequest::common_object_request_params].
    pub fn set_or_clear_common_object_request_params<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommonObjectRequestParams>,
    {
        self.common_object_request_params = v.map(|x| x.into());
        self
    }

    /// Sets the value of [override_unlocked_retention][crate::model::UpdateObjectRequest::override_unlocked_retention].
    pub fn set_override_unlocked_retention<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.override_unlocked_retention = v.into();
        self
    }
}

impl wkt::message::Message for UpdateObjectRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.UpdateObjectRequest"
    }
}

/// Parameters that can be passed to any object request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommonObjectRequestParams {
    /// Optional. Encryption algorithm used with the Customer-Supplied Encryption
    /// Keys feature.
    pub encryption_algorithm: std::string::String,

    /// Optional. Encryption key used with the Customer-Supplied Encryption Keys
    /// feature. In raw bytes format (not base64-encoded).
    pub encryption_key_bytes: ::bytes::Bytes,

    /// Optional. SHA256 hash of encryption key used with the Customer-supplied
    /// encryption keys feature.
    pub encryption_key_sha256_bytes: ::bytes::Bytes,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CommonObjectRequestParams {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [encryption_algorithm][crate::model::CommonObjectRequestParams::encryption_algorithm].
    pub fn set_encryption_algorithm<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.encryption_algorithm = v.into();
        self
    }

    /// Sets the value of [encryption_key_bytes][crate::model::CommonObjectRequestParams::encryption_key_bytes].
    pub fn set_encryption_key_bytes<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.encryption_key_bytes = v.into();
        self
    }

    /// Sets the value of [encryption_key_sha256_bytes][crate::model::CommonObjectRequestParams::encryption_key_sha256_bytes].
    pub fn set_encryption_key_sha256_bytes<T: std::convert::Into<::bytes::Bytes>>(
        mut self,
        v: T,
    ) -> Self {
        self.encryption_key_sha256_bytes = v.into();
        self
    }
}

impl wkt::message::Message for CommonObjectRequestParams {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.CommonObjectRequestParams"
    }
}

/// A bucket.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Bucket {
    /// Identifier. The name of the bucket.
    /// Format: `projects/{project}/buckets/{bucket}`
    pub name: std::string::String,

    /// Output only. The user-chosen part of the bucket name. The `{bucket}`
    /// portion of the `name` field. For globally unique buckets, this is equal to
    /// the `bucket name` of other Cloud Storage APIs. Example: `pub`.
    pub bucket_id: std::string::String,

    /// The etag of the bucket.
    /// If included in the metadata of an `UpdateBucketRequest`, the operation is
    /// only performed if the `etag` matches that of the bucket.
    pub etag: std::string::String,

    /// Immutable. The project which owns this bucket, in the format of
    /// `projects/{projectIdentifier}`.
    /// `{projectIdentifier}` can be the project ID or project number.
    /// Output values are always in the project number format.
    pub project: std::string::String,

    /// Output only. The metadata generation of this bucket.
    pub metageneration: i64,

    /// Immutable. The location of the bucket. Object data for objects in the
    /// bucket resides in physical storage within this region.  Defaults to `US`.
    /// Attempting to update this field after the bucket is created results in an
    /// error.
    pub location: std::string::String,

    /// Output only. The location type of the bucket (region, dual-region,
    /// multi-region, etc).
    pub location_type: std::string::String,

    /// Optional. The bucket's default storage class, used whenever no storageClass
    /// is specified for a newly-created object. This defines how objects in the
    /// bucket are stored and determines the SLA and the cost of storage.
    /// If this value is not specified when the bucket is created, it defaults
    /// to `STANDARD`. For more information, see [Storage
    /// classes](https://developers.google.com/storage/docs/storage-classes).
    pub storage_class: std::string::String,

    /// Optional. The recovery point objective for cross-region replication of the
    /// bucket. Applicable only for dual- and multi-region buckets. `DEFAULT` uses
    /// default replication. `ASYNC_TURBO` enables turbo replication, valid for
    /// dual-region buckets only. If rpo is not specified when the bucket is
    /// created, it defaults to `DEFAULT`. For more information, see [Turbo
    /// replication](https://cloud.google.com/storage/docs/availability-durability#turbo-replication).
    pub rpo: std::string::String,

    /// Optional. Access controls on the bucket.
    /// If `iam_config.uniform_bucket_level_access` is enabled on this bucket,
    /// requests to set, read, or modify acl is an error.
    pub acl: std::vec::Vec<crate::model::BucketAccessControl>,

    /// Optional. Default access controls to apply to new objects when no ACL is
    /// provided. If `iam_config.uniform_bucket_level_access` is enabled on this
    /// bucket, requests to set, read, or modify acl is an error.
    pub default_object_acl: std::vec::Vec<crate::model::ObjectAccessControl>,

    /// Optional. The bucket's lifecycle configuration. See [Lifecycle
    /// Management](https://developers.google.com/storage/docs/lifecycle) for more
    /// information.
    pub lifecycle: std::option::Option<crate::model::bucket::Lifecycle>,

    /// Output only. The creation time of the bucket.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The bucket's [CORS](https://www.w3.org/TR/cors/)
    /// configuration.
    pub cors: std::vec::Vec<crate::model::bucket::Cors>,

    /// Output only. The modification time of the bucket.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The default value for event-based hold on newly created objects
    /// in this bucket.  Event-based hold is a way to retain objects indefinitely
    /// until an event occurs, signified by the hold's release. After being
    /// released, such objects are subject to bucket-level retention (if any).  One
    /// sample use case of this flag is for banks to hold loan documents for at
    /// least 3 years after loan is paid in full. Here, bucket-level retention is 3
    /// years and the event is loan being paid in full. In this example, these
    /// objects are held intact for any number of years until the event has
    /// occurred (event-based hold on the object is released) and then 3 more years
    /// after that. That means retention duration of the objects begins from the
    /// moment event-based hold transitioned from true to false.  Objects under
    /// event-based hold cannot be deleted, overwritten or archived until the hold
    /// is removed.
    pub default_event_based_hold: bool,

    /// Optional. User-provided labels, in key/value pairs.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. The bucket's website config, controlling how the service behaves
    /// when accessing bucket contents as a web site. See the [Static website
    /// examples](https://cloud.google.com/storage/docs/static-website) for more
    /// information.
    pub website: std::option::Option<crate::model::bucket::Website>,

    /// Optional. The bucket's versioning configuration.
    pub versioning: std::option::Option<crate::model::bucket::Versioning>,

    /// Optional. The bucket's logging config, which defines the destination bucket
    /// and name prefix (if any) for the current bucket's logs.
    pub logging: std::option::Option<crate::model::bucket::Logging>,

    /// Output only. The owner of the bucket. This is always the project team's
    /// owner group.
    pub owner: std::option::Option<crate::model::Owner>,

    /// Optional. Encryption config for a bucket.
    pub encryption: std::option::Option<crate::model::bucket::Encryption>,

    /// Optional. The bucket's billing configuration.
    pub billing: std::option::Option<crate::model::bucket::Billing>,

    /// Optional. The bucket's retention policy. The retention policy enforces a
    /// minimum retention time for all objects contained in the bucket, based on
    /// their creation time. Any attempt to overwrite or delete objects younger
    /// than the retention period results in a `PERMISSION_DENIED` error.  An
    /// unlocked retention policy can be modified or removed from the bucket via a
    /// storage.buckets.update operation. A locked retention policy cannot be
    /// removed or shortened in duration for the lifetime of the bucket.
    /// Attempting to remove or decrease period of a locked retention policy
    /// results in a `PERMISSION_DENIED` error.
    pub retention_policy: std::option::Option<crate::model::bucket::RetentionPolicy>,

    /// Optional. The bucket's IAM configuration.
    pub iam_config: std::option::Option<crate::model::bucket::IamConfig>,

    /// Optional. Reserved for future use.
    pub satisfies_pzs: bool,

    /// Optional. Configuration that, if present, specifies the data placement for
    /// a [configurable
    /// dual-region](https://cloud.google.com/storage/docs/locations#location-dr).
    pub custom_placement_config: std::option::Option<crate::model::bucket::CustomPlacementConfig>,

    /// Optional. The bucket's Autoclass configuration. If there is no
    /// configuration, the Autoclass feature is disabled and has no effect on the
    /// bucket.
    pub autoclass: std::option::Option<crate::model::bucket::Autoclass>,

    /// Optional. The bucket's hierarchical namespace configuration. If there is no
    /// configuration, the hierarchical namespace feature is disabled and has
    /// no effect on the bucket.
    pub hierarchical_namespace: std::option::Option<crate::model::bucket::HierarchicalNamespace>,

    /// Optional. The bucket's soft delete policy. The soft delete policy prevents
    /// soft-deleted objects from being permanently deleted.
    pub soft_delete_policy: std::option::Option<crate::model::bucket::SoftDeletePolicy>,

    /// Optional. The bucket's object retention configuration. Must be enabled
    /// before objects in the bucket might have retention configured.
    pub object_retention: std::option::Option<crate::model::bucket::ObjectRetention>,

    /// Optional. The bucket's IP filter configuration.
    pub ip_filter: std::option::Option<crate::model::bucket::IpFilter>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Bucket {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Bucket::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [bucket_id][crate::model::Bucket::bucket_id].
    pub fn set_bucket_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.bucket_id = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::Bucket::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }

    /// Sets the value of [project][crate::model::Bucket::project].
    pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.project = v.into();
        self
    }

    /// Sets the value of [metageneration][crate::model::Bucket::metageneration].
    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.metageneration = v.into();
        self
    }

    /// Sets the value of [location][crate::model::Bucket::location].
    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.location = v.into();
        self
    }

    /// Sets the value of [location_type][crate::model::Bucket::location_type].
    pub fn set_location_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.location_type = v.into();
        self
    }

    /// Sets the value of [storage_class][crate::model::Bucket::storage_class].
    pub fn set_storage_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.storage_class = v.into();
        self
    }

    /// Sets the value of [rpo][crate::model::Bucket::rpo].
    pub fn set_rpo<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.rpo = v.into();
        self
    }

    /// Sets the value of [acl][crate::model::Bucket::acl].
    pub fn set_acl<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::BucketAccessControl>,
    {
        use std::iter::Iterator;
        self.acl = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [default_object_acl][crate::model::Bucket::default_object_acl].
    pub fn set_default_object_acl<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ObjectAccessControl>,
    {
        use std::iter::Iterator;
        self.default_object_acl = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [lifecycle][crate::model::Bucket::lifecycle].
    pub fn set_lifecycle<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Lifecycle>,
    {
        self.lifecycle = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [lifecycle][crate::model::Bucket::lifecycle].
    pub fn set_or_clear_lifecycle<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Lifecycle>,
    {
        self.lifecycle = v.map(|x| x.into());
        self
    }

    /// Sets the value of [create_time][crate::model::Bucket::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Bucket::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [cors][crate::model::Bucket::cors].
    pub fn set_cors<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::bucket::Cors>,
    {
        use std::iter::Iterator;
        self.cors = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [update_time][crate::model::Bucket::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Bucket::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [default_event_based_hold][crate::model::Bucket::default_event_based_hold].
    pub fn set_default_event_based_hold<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.default_event_based_hold = v.into();
        self
    }

    /// Sets the value of [labels][crate::model::Bucket::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [website][crate::model::Bucket::website].
    pub fn set_website<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Website>,
    {
        self.website = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [website][crate::model::Bucket::website].
    pub fn set_or_clear_website<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Website>,
    {
        self.website = v.map(|x| x.into());
        self
    }

    /// Sets the value of [versioning][crate::model::Bucket::versioning].
    pub fn set_versioning<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Versioning>,
    {
        self.versioning = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [versioning][crate::model::Bucket::versioning].
    pub fn set_or_clear_versioning<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Versioning>,
    {
        self.versioning = v.map(|x| x.into());
        self
    }

    /// Sets the value of [logging][crate::model::Bucket::logging].
    pub fn set_logging<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Logging>,
    {
        self.logging = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [logging][crate::model::Bucket::logging].
    pub fn set_or_clear_logging<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Logging>,
    {
        self.logging = v.map(|x| x.into());
        self
    }

    /// Sets the value of [owner][crate::model::Bucket::owner].
    pub fn set_owner<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Owner>,
    {
        self.owner = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [owner][crate::model::Bucket::owner].
    pub fn set_or_clear_owner<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Owner>,
    {
        self.owner = v.map(|x| x.into());
        self
    }

    /// Sets the value of [encryption][crate::model::Bucket::encryption].
    pub fn set_encryption<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Encryption>,
    {
        self.encryption = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [encryption][crate::model::Bucket::encryption].
    pub fn set_or_clear_encryption<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Encryption>,
    {
        self.encryption = v.map(|x| x.into());
        self
    }

    /// Sets the value of [billing][crate::model::Bucket::billing].
    pub fn set_billing<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Billing>,
    {
        self.billing = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [billing][crate::model::Bucket::billing].
    pub fn set_or_clear_billing<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Billing>,
    {
        self.billing = v.map(|x| x.into());
        self
    }

    /// Sets the value of [retention_policy][crate::model::Bucket::retention_policy].
    pub fn set_retention_policy<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::RetentionPolicy>,
    {
        self.retention_policy = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [retention_policy][crate::model::Bucket::retention_policy].
    pub fn set_or_clear_retention_policy<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::RetentionPolicy>,
    {
        self.retention_policy = v.map(|x| x.into());
        self
    }

    /// Sets the value of [iam_config][crate::model::Bucket::iam_config].
    pub fn set_iam_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::IamConfig>,
    {
        self.iam_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [iam_config][crate::model::Bucket::iam_config].
    pub fn set_or_clear_iam_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::IamConfig>,
    {
        self.iam_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [satisfies_pzs][crate::model::Bucket::satisfies_pzs].
    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.satisfies_pzs = v.into();
        self
    }

    /// Sets the value of [custom_placement_config][crate::model::Bucket::custom_placement_config].
    pub fn set_custom_placement_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::CustomPlacementConfig>,
    {
        self.custom_placement_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [custom_placement_config][crate::model::Bucket::custom_placement_config].
    pub fn set_or_clear_custom_placement_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::CustomPlacementConfig>,
    {
        self.custom_placement_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [autoclass][crate::model::Bucket::autoclass].
    pub fn set_autoclass<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Autoclass>,
    {
        self.autoclass = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [autoclass][crate::model::Bucket::autoclass].
    pub fn set_or_clear_autoclass<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::Autoclass>,
    {
        self.autoclass = v.map(|x| x.into());
        self
    }

    /// Sets the value of [hierarchical_namespace][crate::model::Bucket::hierarchical_namespace].
    pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::HierarchicalNamespace>,
    {
        self.hierarchical_namespace = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [hierarchical_namespace][crate::model::Bucket::hierarchical_namespace].
    pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::HierarchicalNamespace>,
    {
        self.hierarchical_namespace = v.map(|x| x.into());
        self
    }

    /// Sets the value of [soft_delete_policy][crate::model::Bucket::soft_delete_policy].
    pub fn set_soft_delete_policy<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::SoftDeletePolicy>,
    {
        self.soft_delete_policy = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [soft_delete_policy][crate::model::Bucket::soft_delete_policy].
    pub fn set_or_clear_soft_delete_policy<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::SoftDeletePolicy>,
    {
        self.soft_delete_policy = v.map(|x| x.into());
        self
    }

    /// Sets the value of [object_retention][crate::model::Bucket::object_retention].
    pub fn set_object_retention<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::ObjectRetention>,
    {
        self.object_retention = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [object_retention][crate::model::Bucket::object_retention].
    pub fn set_or_clear_object_retention<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::ObjectRetention>,
    {
        self.object_retention = v.map(|x| x.into());
        self
    }

    /// Sets the value of [ip_filter][crate::model::Bucket::ip_filter].
    pub fn set_ip_filter<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::bucket::IpFilter>,
    {
        self.ip_filter = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [ip_filter][crate::model::Bucket::ip_filter].
    pub fn set_or_clear_ip_filter<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::bucket::IpFilter>,
    {
        self.ip_filter = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Bucket {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.Bucket"
    }
}

/// Defines additional types related to [Bucket].
pub mod bucket {
    #[allow(unused_imports)]
    use super::*;

    /// Billing properties of a bucket.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Billing {
        /// Optional. When set to true, Requester Pays is enabled for this bucket.
        pub requester_pays: bool,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Billing {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [requester_pays][crate::model::bucket::Billing::requester_pays].
        pub fn set_requester_pays<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.requester_pays = v.into();
            self
        }
    }

    impl wkt::message::Message for Billing {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.Billing"
        }
    }

    /// Cross-Origin Response sharing (CORS) properties for a bucket.
    /// For more on Cloud Storage and CORS, see
    /// <https://cloud.google.com/storage/docs/cross-origin>.
    /// For more on CORS in general, see <https://tools.ietf.org/html/rfc6454>.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Cors {
        /// Optional. The list of origins eligible to receive CORS response headers.
        /// For more information about origins, see [RFC
        /// 6454](https://tools.ietf.org/html/rfc6454). Note: `*` is permitted in the
        /// list of origins, and means `any origin`.
        pub origin: std::vec::Vec<std::string::String>,

        /// Optional. The list of HTTP methods on which to include CORS response
        /// headers,
        /// (`GET`, `OPTIONS`, `POST`, etc) Note: `*` is permitted in the list of
        /// methods, and means "any method".
        pub method: std::vec::Vec<std::string::String>,

        /// Optional. The list of HTTP headers other than the [simple response
        /// headers](https://www.w3.org/TR/cors/#simple-response-headers) to give
        /// permission for the user-agent to share across domains.
        pub response_header: std::vec::Vec<std::string::String>,

        /// Optional. The value, in seconds, to return in the [Access-Control-Max-Age
        /// header](https://www.w3.org/TR/cors/#access-control-max-age-response-header)
        /// used in preflight responses.
        pub max_age_seconds: i32,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Cors {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [origin][crate::model::bucket::Cors::origin].
        pub fn set_origin<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.origin = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [method][crate::model::bucket::Cors::method].
        pub fn set_method<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.method = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [response_header][crate::model::bucket::Cors::response_header].
        pub fn set_response_header<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.response_header = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [max_age_seconds][crate::model::bucket::Cors::max_age_seconds].
        pub fn set_max_age_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.max_age_seconds = v.into();
            self
        }
    }

    impl wkt::message::Message for Cors {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.Cors"
        }
    }

    /// Encryption properties of a bucket.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Encryption {
        /// Optional. The name of the Cloud KMS key that is used to encrypt objects
        /// inserted into this bucket, if no encryption method is specified.
        pub default_kms_key: std::string::String,

        /// Optional. If omitted, then new objects with GMEK encryption-type is
        /// allowed. If set, then new objects created in this bucket must comply with
        /// enforcement config. Changing this has no effect on existing objects; it
        /// applies to new objects only.
        pub google_managed_encryption_enforcement_config: std::option::Option<
            crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig,
        >,

        /// Optional. If omitted, then new objects with CMEK encryption-type is
        /// allowed. If set, then new objects created in this bucket must comply with
        /// enforcement config. Changing this has no effect on existing objects; it
        /// applies to new objects only.
        pub customer_managed_encryption_enforcement_config: std::option::Option<
            crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig,
        >,

        /// Optional. If omitted, then new objects with CSEK encryption-type is
        /// allowed. If set, then new objects created in this bucket must comply with
        /// enforcement config. Changing this has no effect on existing objects; it
        /// applies to new objects only.
        pub customer_supplied_encryption_enforcement_config: std::option::Option<
            crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig,
        >,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Encryption {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [default_kms_key][crate::model::bucket::Encryption::default_kms_key].
        pub fn set_default_kms_key<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.default_kms_key = v.into();
            self
        }

        /// Sets the value of [google_managed_encryption_enforcement_config][crate::model::bucket::Encryption::google_managed_encryption_enforcement_config].
        pub fn set_google_managed_encryption_enforcement_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<
                    crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig,
                >,
        {
            self.google_managed_encryption_enforcement_config = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [google_managed_encryption_enforcement_config][crate::model::bucket::Encryption::google_managed_encryption_enforcement_config].
        pub fn set_or_clear_google_managed_encryption_enforcement_config<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<
                    crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig,
                >,
        {
            self.google_managed_encryption_enforcement_config = v.map(|x| x.into());
            self
        }

        /// Sets the value of [customer_managed_encryption_enforcement_config][crate::model::bucket::Encryption::customer_managed_encryption_enforcement_config].
        pub fn set_customer_managed_encryption_enforcement_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<
                    crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig,
                >,
        {
            self.customer_managed_encryption_enforcement_config =
                std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [customer_managed_encryption_enforcement_config][crate::model::bucket::Encryption::customer_managed_encryption_enforcement_config].
        pub fn set_or_clear_customer_managed_encryption_enforcement_config<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<
                    crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig,
                >,
        {
            self.customer_managed_encryption_enforcement_config = v.map(|x| x.into());
            self
        }

        /// Sets the value of [customer_supplied_encryption_enforcement_config][crate::model::bucket::Encryption::customer_supplied_encryption_enforcement_config].
        pub fn set_customer_supplied_encryption_enforcement_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<
                    crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig,
                >,
        {
            self.customer_supplied_encryption_enforcement_config =
                std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [customer_supplied_encryption_enforcement_config][crate::model::bucket::Encryption::customer_supplied_encryption_enforcement_config].
        pub fn set_or_clear_customer_supplied_encryption_enforcement_config<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<
                    crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig,
                >,
        {
            self.customer_supplied_encryption_enforcement_config = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for Encryption {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.Encryption"
        }
    }

    /// Defines additional types related to [Encryption].
    pub mod encryption {
        #[allow(unused_imports)]
        use super::*;

        /// Google Managed Encryption (GMEK) enforcement config of a bucket.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct GoogleManagedEncryptionEnforcementConfig {
            /// Restriction mode for google-managed encryption for new objects within
            /// the bucket. Valid values are: `NotRestricted` and `FullyRestricted`.
            /// If `NotRestricted` or unset, creation of new objects with
            /// google-managed encryption is allowed.
            /// If `FullyRestricted`, new objects can't be created using google-managed
            /// encryption.
            pub restriction_mode: std::option::Option<std::string::String>,

            /// Time from which the config was effective. This is service-provided.
            pub effective_time: std::option::Option<wkt::Timestamp>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl GoogleManagedEncryptionEnforcementConfig {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [restriction_mode][crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig::restriction_mode].
            pub fn set_restriction_mode<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<std::string::String>,
            {
                self.restriction_mode = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [restriction_mode][crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig::restriction_mode].
            pub fn set_or_clear_restriction_mode<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<std::string::String>,
            {
                self.restriction_mode = v.map(|x| x.into());
                self
            }

            /// Sets the value of [effective_time][crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig::effective_time].
            pub fn set_effective_time<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<wkt::Timestamp>,
            {
                self.effective_time = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [effective_time][crate::model::bucket::encryption::GoogleManagedEncryptionEnforcementConfig::effective_time].
            pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<wkt::Timestamp>,
            {
                self.effective_time = v.map(|x| x.into());
                self
            }
        }

        impl wkt::message::Message for GoogleManagedEncryptionEnforcementConfig {
            fn typename() -> &'static str {
                "type.googleapis.com/google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig"
            }
        }

        /// Customer Managed Encryption (CMEK) enforcement config of a bucket.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct CustomerManagedEncryptionEnforcementConfig {
            /// Restriction mode for customer-managed encryption for new objects within
            /// the bucket. Valid values are: `NotRestricted` and `FullyRestricted`.
            /// If `NotRestricted` or unset, creation of new objects with
            /// customer-managed encryption is allowed.
            /// If `FullyRestricted`, new objects can't be created using
            /// customer-managed encryption.
            pub restriction_mode: std::option::Option<std::string::String>,

            /// Time from which the config was effective. This is service-provided.
            pub effective_time: std::option::Option<wkt::Timestamp>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl CustomerManagedEncryptionEnforcementConfig {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [restriction_mode][crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig::restriction_mode].
            pub fn set_restriction_mode<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<std::string::String>,
            {
                self.restriction_mode = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [restriction_mode][crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig::restriction_mode].
            pub fn set_or_clear_restriction_mode<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<std::string::String>,
            {
                self.restriction_mode = v.map(|x| x.into());
                self
            }

            /// Sets the value of [effective_time][crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig::effective_time].
            pub fn set_effective_time<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<wkt::Timestamp>,
            {
                self.effective_time = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [effective_time][crate::model::bucket::encryption::CustomerManagedEncryptionEnforcementConfig::effective_time].
            pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<wkt::Timestamp>,
            {
                self.effective_time = v.map(|x| x.into());
                self
            }
        }

        impl wkt::message::Message for CustomerManagedEncryptionEnforcementConfig {
            fn typename() -> &'static str {
                "type.googleapis.com/google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig"
            }
        }

        /// Customer Supplied Encryption (CSEK) enforcement config of a bucket.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct CustomerSuppliedEncryptionEnforcementConfig {
            /// Restriction mode for customer-supplied encryption for new objects
            /// within the bucket. Valid values are: `NotRestricted` and
            /// `FullyRestricted`.
            /// If `NotRestricted` or unset, creation of new objects with
            /// customer-supplied encryption is allowed.
            /// If `FullyRestricted`, new objects can't be created using
            /// customer-supplied encryption.
            pub restriction_mode: std::option::Option<std::string::String>,

            /// Time from which the config was effective. This is service-provided.
            pub effective_time: std::option::Option<wkt::Timestamp>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl CustomerSuppliedEncryptionEnforcementConfig {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [restriction_mode][crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig::restriction_mode].
            pub fn set_restriction_mode<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<std::string::String>,
            {
                self.restriction_mode = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [restriction_mode][crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig::restriction_mode].
            pub fn set_or_clear_restriction_mode<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<std::string::String>,
            {
                self.restriction_mode = v.map(|x| x.into());
                self
            }

            /// Sets the value of [effective_time][crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig::effective_time].
            pub fn set_effective_time<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<wkt::Timestamp>,
            {
                self.effective_time = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [effective_time][crate::model::bucket::encryption::CustomerSuppliedEncryptionEnforcementConfig::effective_time].
            pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<wkt::Timestamp>,
            {
                self.effective_time = v.map(|x| x.into());
                self
            }
        }

        impl wkt::message::Message for CustomerSuppliedEncryptionEnforcementConfig {
            fn typename() -> &'static str {
                "type.googleapis.com/google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig"
            }
        }
    }

    /// Bucket restriction options.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct IamConfig {
        /// Optional. Bucket restriction options currently enforced on the bucket.
        pub uniform_bucket_level_access:
            std::option::Option<crate::model::bucket::iam_config::UniformBucketLevelAccess>,

        /// Optional. Whether IAM enforces public access prevention. Valid values are
        /// `enforced` or `inherited`.
        pub public_access_prevention: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl IamConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [uniform_bucket_level_access][crate::model::bucket::IamConfig::uniform_bucket_level_access].
        pub fn set_uniform_bucket_level_access<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::bucket::iam_config::UniformBucketLevelAccess>,
        {
            self.uniform_bucket_level_access = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [uniform_bucket_level_access][crate::model::bucket::IamConfig::uniform_bucket_level_access].
        pub fn set_or_clear_uniform_bucket_level_access<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<crate::model::bucket::iam_config::UniformBucketLevelAccess>,
        {
            self.uniform_bucket_level_access = v.map(|x| x.into());
            self
        }

        /// Sets the value of [public_access_prevention][crate::model::bucket::IamConfig::public_access_prevention].
        pub fn set_public_access_prevention<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.public_access_prevention = v.into();
            self
        }
    }

    impl wkt::message::Message for IamConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.IamConfig"
        }
    }

    /// Defines additional types related to [IamConfig].
    pub mod iam_config {
        #[allow(unused_imports)]
        use super::*;

        /// Settings for Uniform Bucket level access.
        /// See <https://cloud.google.com/storage/docs/uniform-bucket-level-access>.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct UniformBucketLevelAccess {
            /// Optional. If set, access checks only use bucket-level IAM policies or
            /// above.
            pub enabled: bool,

            /// Optional. The deadline time for changing
            /// `iam_config.uniform_bucket_level_access.enabled` from `true` to
            /// `false`. Mutable until the specified deadline is reached, but not
            /// afterward.
            pub lock_time: std::option::Option<wkt::Timestamp>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl UniformBucketLevelAccess {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [enabled][crate::model::bucket::iam_config::UniformBucketLevelAccess::enabled].
            pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
                self.enabled = v.into();
                self
            }

            /// Sets the value of [lock_time][crate::model::bucket::iam_config::UniformBucketLevelAccess::lock_time].
            pub fn set_lock_time<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<wkt::Timestamp>,
            {
                self.lock_time = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [lock_time][crate::model::bucket::iam_config::UniformBucketLevelAccess::lock_time].
            pub fn set_or_clear_lock_time<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<wkt::Timestamp>,
            {
                self.lock_time = v.map(|x| x.into());
                self
            }
        }

        impl wkt::message::Message for UniformBucketLevelAccess {
            fn typename() -> &'static str {
                "type.googleapis.com/google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess"
            }
        }
    }

    /// Lifecycle properties of a bucket.
    /// For more information, see [Object Lifecycle
    /// Management](https://cloud.google.com/storage/docs/lifecycle).
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Lifecycle {
        /// Optional. A lifecycle management rule, which is made of an action to take
        /// and the condition under which the action is taken.
        pub rule: std::vec::Vec<crate::model::bucket::lifecycle::Rule>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Lifecycle {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [rule][crate::model::bucket::Lifecycle::rule].
        pub fn set_rule<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::bucket::lifecycle::Rule>,
        {
            use std::iter::Iterator;
            self.rule = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for Lifecycle {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.Lifecycle"
        }
    }

    /// Defines additional types related to [Lifecycle].
    pub mod lifecycle {
        #[allow(unused_imports)]
        use super::*;

        /// A lifecycle Rule, combining an action to take on an object and a
        /// condition which triggers that action.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct Rule {
            /// Optional. The action to take.
            pub action: std::option::Option<crate::model::bucket::lifecycle::rule::Action>,

            /// Optional. The condition under which the action is taken.
            pub condition: std::option::Option<crate::model::bucket::lifecycle::rule::Condition>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl Rule {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [action][crate::model::bucket::lifecycle::Rule::action].
            pub fn set_action<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<crate::model::bucket::lifecycle::rule::Action>,
            {
                self.action = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [action][crate::model::bucket::lifecycle::Rule::action].
            pub fn set_or_clear_action<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<crate::model::bucket::lifecycle::rule::Action>,
            {
                self.action = v.map(|x| x.into());
                self
            }

            /// Sets the value of [condition][crate::model::bucket::lifecycle::Rule::condition].
            pub fn set_condition<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<crate::model::bucket::lifecycle::rule::Condition>,
            {
                self.condition = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [condition][crate::model::bucket::lifecycle::Rule::condition].
            pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<crate::model::bucket::lifecycle::rule::Condition>,
            {
                self.condition = v.map(|x| x.into());
                self
            }
        }

        impl wkt::message::Message for Rule {
            fn typename() -> &'static str {
                "type.googleapis.com/google.storage.v2.Bucket.Lifecycle.Rule"
            }
        }

        /// Defines additional types related to [Rule].
        pub mod rule {
            #[allow(unused_imports)]
            use super::*;

            /// An action to take on an object.
            #[derive(Clone, Default, PartialEq)]
            #[non_exhaustive]
            pub struct Action {
                /// Optional. Type of the action. Currently, only `Delete`,
                /// `SetStorageClass`, and `AbortIncompleteMultipartUpload` are
                /// supported.
                pub r#type: std::string::String,

                /// Optional. Target storage class. Required iff the type of the action
                /// is SetStorageClass.
                pub storage_class: std::string::String,

                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
            }

            impl Action {
                pub fn new() -> Self {
                    std::default::Default::default()
                }

                /// Sets the value of [r#type][crate::model::bucket::lifecycle::rule::Action::type].
                pub fn set_type<T: std::convert::Into<std::string::String>>(
                    mut self,
                    v: T,
                ) -> Self {
                    self.r#type = v.into();
                    self
                }

                /// Sets the value of [storage_class][crate::model::bucket::lifecycle::rule::Action::storage_class].
                pub fn set_storage_class<T: std::convert::Into<std::string::String>>(
                    mut self,
                    v: T,
                ) -> Self {
                    self.storage_class = v.into();
                    self
                }
            }

            impl wkt::message::Message for Action {
                fn typename() -> &'static str {
                    "type.googleapis.com/google.storage.v2.Bucket.Lifecycle.Rule.Action"
                }
            }

            /// A condition of an object which triggers some action.
            #[derive(Clone, Default, PartialEq)]
            #[non_exhaustive]
            pub struct Condition {
                /// Age of an object (in days). This condition is satisfied when an
                /// object reaches the specified age.
                /// A value of 0 indicates that all objects immediately match this
                /// condition.
                pub age_days: std::option::Option<i32>,

                /// Optional. This condition is satisfied when an object is created
                /// before midnight of the specified date in UTC.
                pub created_before: std::option::Option<gtype::model::Date>,

                /// Relevant only for versioned objects. If the value is
                /// `true`, this condition matches live objects; if the value
                /// is `false`, it matches archived objects.
                pub is_live: std::option::Option<bool>,

                /// Relevant only for versioned objects. If the value is N, this
                /// condition is satisfied when there are at least N versions (including
                /// the live version) newer than this version of the object.
                pub num_newer_versions: std::option::Option<i32>,

                /// Optional. Objects having any of the storage classes specified by this
                /// condition are matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
                /// `NEARLINE`, `COLDLINE`, `STANDARD`, and
                /// `DURABLE_REDUCED_AVAILABILITY`.
                pub matches_storage_class: std::vec::Vec<std::string::String>,

                /// Number of days that have elapsed since the custom timestamp set on an
                /// object.
                /// The value of the field must be a nonnegative integer.
                pub days_since_custom_time: std::option::Option<i32>,

                /// Optional. An object matches this condition if the custom timestamp
                /// set on the object is before the specified date in UTC.
                pub custom_time_before: std::option::Option<gtype::model::Date>,

                /// This condition is relevant only for versioned objects. An object
                /// version satisfies this condition only if these many days have been
                /// passed since it became noncurrent. The value of the field must be a
                /// nonnegative integer. If it's zero, the object version becomes
                /// eligible for Lifecycle action as soon as it becomes noncurrent.
                pub days_since_noncurrent_time: std::option::Option<i32>,

                /// Optional. This condition is relevant only for versioned objects. An
                /// object version satisfies this condition only if it became noncurrent
                /// before the specified date in UTC.
                pub noncurrent_time_before: std::option::Option<gtype::model::Date>,

                /// Optional. List of object name prefixes. If any prefix exactly matches
                /// the beginning of the object name, the condition evaluates to true.
                pub matches_prefix: std::vec::Vec<std::string::String>,

                /// Optional. List of object name suffixes. If any suffix exactly matches
                /// the end of the object name, the condition evaluates to true.
                pub matches_suffix: std::vec::Vec<std::string::String>,

                pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
            }

            impl Condition {
                pub fn new() -> Self {
                    std::default::Default::default()
                }

                /// Sets the value of [age_days][crate::model::bucket::lifecycle::rule::Condition::age_days].
                pub fn set_age_days<T>(mut self, v: T) -> Self
                where
                    T: std::convert::Into<i32>,
                {
                    self.age_days = std::option::Option::Some(v.into());
                    self
                }

                /// Sets or clears the value of [age_days][crate::model::bucket::lifecycle::rule::Condition::age_days].
                pub fn set_or_clear_age_days<T>(mut self, v: std::option::Option<T>) -> Self
                where
                    T: std::convert::Into<i32>,
                {
                    self.age_days = v.map(|x| x.into());
                    self
                }

                /// Sets the value of [created_before][crate::model::bucket::lifecycle::rule::Condition::created_before].
                pub fn set_created_before<T>(mut self, v: T) -> Self
                where
                    T: std::convert::Into<gtype::model::Date>,
                {
                    self.created_before = std::option::Option::Some(v.into());
                    self
                }

                /// Sets or clears the value of [created_before][crate::model::bucket::lifecycle::rule::Condition::created_before].
                pub fn set_or_clear_created_before<T>(mut self, v: std::option::Option<T>) -> Self
                where
                    T: std::convert::Into<gtype::model::Date>,
                {
                    self.created_before = v.map(|x| x.into());
                    self
                }

                /// Sets the value of [is_live][crate::model::bucket::lifecycle::rule::Condition::is_live].
                pub fn set_is_live<T>(mut self, v: T) -> Self
                where
                    T: std::convert::Into<bool>,
                {
                    self.is_live = std::option::Option::Some(v.into());
                    self
                }

                /// Sets or clears the value of [is_live][crate::model::bucket::lifecycle::rule::Condition::is_live].
                pub fn set_or_clear_is_live<T>(mut self, v: std::option::Option<T>) -> Self
                where
                    T: std::convert::Into<bool>,
                {
                    self.is_live = v.map(|x| x.into());
                    self
                }

                /// Sets the value of [num_newer_versions][crate::model::bucket::lifecycle::rule::Condition::num_newer_versions].
                pub fn set_num_newer_versions<T>(mut self, v: T) -> Self
                where
                    T: std::convert::Into<i32>,
                {
                    self.num_newer_versions = std::option::Option::Some(v.into());
                    self
                }

                /// Sets or clears the value of [num_newer_versions][crate::model::bucket::lifecycle::rule::Condition::num_newer_versions].
                pub fn set_or_clear_num_newer_versions<T>(
                    mut self,
                    v: std::option::Option<T>,
                ) -> Self
                where
                    T: std::convert::Into<i32>,
                {
                    self.num_newer_versions = v.map(|x| x.into());
                    self
                }

                /// Sets the value of [matches_storage_class][crate::model::bucket::lifecycle::rule::Condition::matches_storage_class].
                pub fn set_matches_storage_class<T, V>(mut self, v: T) -> Self
                where
                    T: std::iter::IntoIterator<Item = V>,
                    V: std::convert::Into<std::string::String>,
                {
                    use std::iter::Iterator;
                    self.matches_storage_class = v.into_iter().map(|i| i.into()).collect();
                    self
                }

                /// Sets the value of [days_since_custom_time][crate::model::bucket::lifecycle::rule::Condition::days_since_custom_time].
                pub fn set_days_since_custom_time<T>(mut self, v: T) -> Self
                where
                    T: std::convert::Into<i32>,
                {
                    self.days_since_custom_time = std::option::Option::Some(v.into());
                    self
                }

                /// Sets or clears the value of [days_since_custom_time][crate::model::bucket::lifecycle::rule::Condition::days_since_custom_time].
                pub fn set_or_clear_days_since_custom_time<T>(
                    mut self,
                    v: std::option::Option<T>,
                ) -> Self
                where
                    T: std::convert::Into<i32>,
                {
                    self.days_since_custom_time = v.map(|x| x.into());
                    self
                }

                /// Sets the value of [custom_time_before][crate::model::bucket::lifecycle::rule::Condition::custom_time_before].
                pub fn set_custom_time_before<T>(mut self, v: T) -> Self
                where
                    T: std::convert::Into<gtype::model::Date>,
                {
                    self.custom_time_before = std::option::Option::Some(v.into());
                    self
                }

                /// Sets or clears the value of [custom_time_before][crate::model::bucket::lifecycle::rule::Condition::custom_time_before].
                pub fn set_or_clear_custom_time_before<T>(
                    mut self,
                    v: std::option::Option<T>,
                ) -> Self
                where
                    T: std::convert::Into<gtype::model::Date>,
                {
                    self.custom_time_before = v.map(|x| x.into());
                    self
                }

                /// Sets the value of [days_since_noncurrent_time][crate::model::bucket::lifecycle::rule::Condition::days_since_noncurrent_time].
                pub fn set_days_since_noncurrent_time<T>(mut self, v: T) -> Self
                where
                    T: std::convert::Into<i32>,
                {
                    self.days_since_noncurrent_time = std::option::Option::Some(v.into());
                    self
                }

                /// Sets or clears the value of [days_since_noncurrent_time][crate::model::bucket::lifecycle::rule::Condition::days_since_noncurrent_time].
                pub fn set_or_clear_days_since_noncurrent_time<T>(
                    mut self,
                    v: std::option::Option<T>,
                ) -> Self
                where
                    T: std::convert::Into<i32>,
                {
                    self.days_since_noncurrent_time = v.map(|x| x.into());
                    self
                }

                /// Sets the value of [noncurrent_time_before][crate::model::bucket::lifecycle::rule::Condition::noncurrent_time_before].
                pub fn set_noncurrent_time_before<T>(mut self, v: T) -> Self
                where
                    T: std::convert::Into<gtype::model::Date>,
                {
                    self.noncurrent_time_before = std::option::Option::Some(v.into());
                    self
                }

                /// Sets or clears the value of [noncurrent_time_before][crate::model::bucket::lifecycle::rule::Condition::noncurrent_time_before].
                pub fn set_or_clear_noncurrent_time_before<T>(
                    mut self,
                    v: std::option::Option<T>,
                ) -> Self
                where
                    T: std::convert::Into<gtype::model::Date>,
                {
                    self.noncurrent_time_before = v.map(|x| x.into());
                    self
                }

                /// Sets the value of [matches_prefix][crate::model::bucket::lifecycle::rule::Condition::matches_prefix].
                pub fn set_matches_prefix<T, V>(mut self, v: T) -> Self
                where
                    T: std::iter::IntoIterator<Item = V>,
                    V: std::convert::Into<std::string::String>,
                {
                    use std::iter::Iterator;
                    self.matches_prefix = v.into_iter().map(|i| i.into()).collect();
                    self
                }

                /// Sets the value of [matches_suffix][crate::model::bucket::lifecycle::rule::Condition::matches_suffix].
                pub fn set_matches_suffix<T, V>(mut self, v: T) -> Self
                where
                    T: std::iter::IntoIterator<Item = V>,
                    V: std::convert::Into<std::string::String>,
                {
                    use std::iter::Iterator;
                    self.matches_suffix = v.into_iter().map(|i| i.into()).collect();
                    self
                }
            }

            impl wkt::message::Message for Condition {
                fn typename() -> &'static str {
                    "type.googleapis.com/google.storage.v2.Bucket.Lifecycle.Rule.Condition"
                }
            }
        }
    }

    /// Logging-related properties of a bucket.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Logging {
        /// Optional. The destination bucket where the current bucket's logs should
        /// be placed, using path format (like `projects/123456/buckets/foo`).
        pub log_bucket: std::string::String,

        /// Optional. A prefix for log object names.
        pub log_object_prefix: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Logging {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [log_bucket][crate::model::bucket::Logging::log_bucket].
        pub fn set_log_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.log_bucket = v.into();
            self
        }

        /// Sets the value of [log_object_prefix][crate::model::bucket::Logging::log_object_prefix].
        pub fn set_log_object_prefix<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.log_object_prefix = v.into();
            self
        }
    }

    impl wkt::message::Message for Logging {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.Logging"
        }
    }

    /// Object Retention related properties of a bucket.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ObjectRetention {
        /// Optional. Output only. If true, object retention is enabled for the
        /// bucket.
        pub enabled: bool,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ObjectRetention {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [enabled][crate::model::bucket::ObjectRetention::enabled].
        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.enabled = v.into();
            self
        }
    }

    impl wkt::message::Message for ObjectRetention {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.ObjectRetention"
        }
    }

    /// Retention policy properties of a bucket.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct RetentionPolicy {
        /// Optional. Server-determined value that indicates the time from which
        /// policy was enforced and effective.
        pub effective_time: std::option::Option<wkt::Timestamp>,

        /// Optional. Once locked, an object retention policy cannot be modified.
        pub is_locked: bool,

        /// Optional. The duration that objects need to be retained. Retention
        /// duration must be greater than zero and less than 100 years. Note that
        /// enforcement of retention periods less than a day is not guaranteed. Such
        /// periods should only be used for testing purposes. Any `nanos` value
        /// specified is rounded down to the nearest second.
        pub retention_duration: std::option::Option<wkt::Duration>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl RetentionPolicy {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [effective_time][crate::model::bucket::RetentionPolicy::effective_time].
        pub fn set_effective_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.effective_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [effective_time][crate::model::bucket::RetentionPolicy::effective_time].
        pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.effective_time = v.map(|x| x.into());
            self
        }

        /// Sets the value of [is_locked][crate::model::bucket::RetentionPolicy::is_locked].
        pub fn set_is_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.is_locked = v.into();
            self
        }

        /// Sets the value of [retention_duration][crate::model::bucket::RetentionPolicy::retention_duration].
        pub fn set_retention_duration<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.retention_duration = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [retention_duration][crate::model::bucket::RetentionPolicy::retention_duration].
        pub fn set_or_clear_retention_duration<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.retention_duration = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for RetentionPolicy {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.RetentionPolicy"
        }
    }

    /// Soft delete policy properties of a bucket.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SoftDeletePolicy {
        /// The period of time that soft-deleted objects in the bucket must be
        /// retained and cannot be permanently deleted. The duration must be greater
        /// than or equal to 7 days and less than 1 year.
        pub retention_duration: std::option::Option<wkt::Duration>,

        /// Time from which the policy was effective. This is service-provided.
        pub effective_time: std::option::Option<wkt::Timestamp>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SoftDeletePolicy {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [retention_duration][crate::model::bucket::SoftDeletePolicy::retention_duration].
        pub fn set_retention_duration<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.retention_duration = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [retention_duration][crate::model::bucket::SoftDeletePolicy::retention_duration].
        pub fn set_or_clear_retention_duration<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.retention_duration = v.map(|x| x.into());
            self
        }

        /// Sets the value of [effective_time][crate::model::bucket::SoftDeletePolicy::effective_time].
        pub fn set_effective_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.effective_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [effective_time][crate::model::bucket::SoftDeletePolicy::effective_time].
        pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.effective_time = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for SoftDeletePolicy {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.SoftDeletePolicy"
        }
    }

    /// Properties of a bucket related to versioning.
    /// For more information about Cloud Storage versioning, see [Object
    /// versioning](https://cloud.google.com/storage/docs/object-versioning).
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Versioning {
        /// Optional. While set to true, versioning is fully enabled for this bucket.
        pub enabled: bool,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Versioning {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [enabled][crate::model::bucket::Versioning::enabled].
        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.enabled = v.into();
            self
        }
    }

    impl wkt::message::Message for Versioning {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.Versioning"
        }
    }

    /// Properties of a bucket related to accessing the contents as a static
    /// website. For details, see [hosting a static website using Cloud
    /// Storage](https://cloud.google.com/storage/docs/hosting-static-website).
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Website {
        /// Optional. If the requested object path is missing, the service ensures
        /// the path has a trailing '/', append this suffix, and attempt to retrieve
        /// the resulting object. This allows the creation of `index.html` objects to
        /// represent directory pages.
        pub main_page_suffix: std::string::String,

        /// Optional. If the requested object path is missing, and any
        /// `mainPageSuffix` object is missing, if applicable, the service
        /// returns the named object from this bucket as the content for a
        /// [404 Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)
        /// result.
        pub not_found_page: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Website {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [main_page_suffix][crate::model::bucket::Website::main_page_suffix].
        pub fn set_main_page_suffix<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.main_page_suffix = v.into();
            self
        }

        /// Sets the value of [not_found_page][crate::model::bucket::Website::not_found_page].
        pub fn set_not_found_page<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.not_found_page = v.into();
            self
        }
    }

    impl wkt::message::Message for Website {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.Website"
        }
    }

    /// Configuration for [configurable dual-
    /// regions](https://cloud.google.com/storage/docs/locations#configurable). It
    /// should specify precisely two eligible regions within the same multi-region.
    /// For details, see
    /// [locations](https://cloud.google.com/storage/docs/locations).
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct CustomPlacementConfig {
        /// Optional. List of locations to use for data placement.
        pub data_locations: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl CustomPlacementConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [data_locations][crate::model::bucket::CustomPlacementConfig::data_locations].
        pub fn set_data_locations<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.data_locations = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for CustomPlacementConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.CustomPlacementConfig"
        }
    }

    /// Configuration for a bucket's Autoclass feature.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Autoclass {
        /// Optional. Enables Autoclass.
        pub enabled: bool,

        /// Output only. Latest instant at which the `enabled` field was set to true
        /// after being disabled/unconfigured or set to false after being enabled. If
        /// Autoclass is enabled when the bucket is created, the value of the
        /// `toggle_time` field is set to the bucket `create_time`.
        pub toggle_time: std::option::Option<wkt::Timestamp>,

        /// An object in an Autoclass bucket eventually cools down to the
        /// terminal storage class if there is no access to the object.
        /// The only valid values are NEARLINE and ARCHIVE.
        pub terminal_storage_class: std::option::Option<std::string::String>,

        /// Output only. Latest instant at which the autoclass terminal storage class
        /// was updated.
        pub terminal_storage_class_update_time: std::option::Option<wkt::Timestamp>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Autoclass {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [enabled][crate::model::bucket::Autoclass::enabled].
        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.enabled = v.into();
            self
        }

        /// Sets the value of [toggle_time][crate::model::bucket::Autoclass::toggle_time].
        pub fn set_toggle_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.toggle_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [toggle_time][crate::model::bucket::Autoclass::toggle_time].
        pub fn set_or_clear_toggle_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.toggle_time = v.map(|x| x.into());
            self
        }

        /// Sets the value of [terminal_storage_class][crate::model::bucket::Autoclass::terminal_storage_class].
        pub fn set_terminal_storage_class<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.terminal_storage_class = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [terminal_storage_class][crate::model::bucket::Autoclass::terminal_storage_class].
        pub fn set_or_clear_terminal_storage_class<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.terminal_storage_class = v.map(|x| x.into());
            self
        }

        /// Sets the value of [terminal_storage_class_update_time][crate::model::bucket::Autoclass::terminal_storage_class_update_time].
        pub fn set_terminal_storage_class_update_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.terminal_storage_class_update_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [terminal_storage_class_update_time][crate::model::bucket::Autoclass::terminal_storage_class_update_time].
        pub fn set_or_clear_terminal_storage_class_update_time<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.terminal_storage_class_update_time = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for Autoclass {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.Autoclass"
        }
    }

    /// The [bucket IP
    /// filtering](https://cloud.google.com/storage/docs/ip-filtering-overview)
    /// configuration. Specifies the network sources that can access the bucket, as
    /// well as its underlying objects.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct IpFilter {
        /// The state of the IP filter configuration. Valid values are `Enabled` and
        /// `Disabled`. When set to `Enabled`, IP filtering rules are applied to a
        /// bucket and all incoming requests to the bucket are evaluated against
        /// these rules. When set to `Disabled`, IP filtering rules are not applied
        /// to a bucket.
        pub mode: std::option::Option<std::string::String>,

        /// Public IPs allowed to operate or access the bucket.
        pub public_network_source:
            std::option::Option<crate::model::bucket::ip_filter::PublicNetworkSource>,

        /// Optional. The list of network sources that are allowed to access
        /// operations on the bucket or the underlying objects.
        pub vpc_network_sources: std::vec::Vec<crate::model::bucket::ip_filter::VpcNetworkSource>,

        /// Optional. Whether or not to allow VPCs from orgs different than the
        /// bucket's parent org to access the bucket. When set to true, validations
        /// on the existence of the VPCs won't be performed. If set to false, each
        /// VPC network source is checked to belong to the same org as the bucket as
        /// well as validated for existence.
        pub allow_cross_org_vpcs: bool,

        /// Whether or not to allow all P4SA access to the bucket. When set to true,
        /// IP filter config validation doesn't apply.
        pub allow_all_service_agent_access: std::option::Option<bool>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl IpFilter {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [mode][crate::model::bucket::IpFilter::mode].
        pub fn set_mode<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.mode = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [mode][crate::model::bucket::IpFilter::mode].
        pub fn set_or_clear_mode<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.mode = v.map(|x| x.into());
            self
        }

        /// Sets the value of [public_network_source][crate::model::bucket::IpFilter::public_network_source].
        pub fn set_public_network_source<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::bucket::ip_filter::PublicNetworkSource>,
        {
            self.public_network_source = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [public_network_source][crate::model::bucket::IpFilter::public_network_source].
        pub fn set_or_clear_public_network_source<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::bucket::ip_filter::PublicNetworkSource>,
        {
            self.public_network_source = v.map(|x| x.into());
            self
        }

        /// Sets the value of [vpc_network_sources][crate::model::bucket::IpFilter::vpc_network_sources].
        pub fn set_vpc_network_sources<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::bucket::ip_filter::VpcNetworkSource>,
        {
            use std::iter::Iterator;
            self.vpc_network_sources = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [allow_cross_org_vpcs][crate::model::bucket::IpFilter::allow_cross_org_vpcs].
        pub fn set_allow_cross_org_vpcs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.allow_cross_org_vpcs = v.into();
            self
        }

        /// Sets the value of [allow_all_service_agent_access][crate::model::bucket::IpFilter::allow_all_service_agent_access].
        pub fn set_allow_all_service_agent_access<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.allow_all_service_agent_access = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [allow_all_service_agent_access][crate::model::bucket::IpFilter::allow_all_service_agent_access].
        pub fn set_or_clear_allow_all_service_agent_access<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.allow_all_service_agent_access = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for IpFilter {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.IpFilter"
        }
    }

    /// Defines additional types related to [IpFilter].
    pub mod ip_filter {
        #[allow(unused_imports)]
        use super::*;

        /// The public network IP address ranges that can access the bucket and its
        /// data.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct PublicNetworkSource {
            /// Optional. The list of IPv4 and IPv6 cidr blocks that are allowed to
            /// operate or access the bucket and its underlying objects.
            pub allowed_ip_cidr_ranges: std::vec::Vec<std::string::String>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl PublicNetworkSource {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [allowed_ip_cidr_ranges][crate::model::bucket::ip_filter::PublicNetworkSource::allowed_ip_cidr_ranges].
            pub fn set_allowed_ip_cidr_ranges<T, V>(mut self, v: T) -> Self
            where
                T: std::iter::IntoIterator<Item = V>,
                V: std::convert::Into<std::string::String>,
            {
                use std::iter::Iterator;
                self.allowed_ip_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
                self
            }
        }

        impl wkt::message::Message for PublicNetworkSource {
            fn typename() -> &'static str {
                "type.googleapis.com/google.storage.v2.Bucket.IpFilter.PublicNetworkSource"
            }
        }

        /// The list of VPC networks that can access the bucket.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct VpcNetworkSource {
            /// Name of the network.
            ///
            /// Format: `projects/PROJECT_ID/global/networks/NETWORK_NAME`
            pub network: std::option::Option<std::string::String>,

            /// Optional. The list of public or private IPv4 and IPv6 CIDR ranges that
            /// can access the bucket. In the CIDR IP address block, the specified IP
            /// address must be properly truncated, meaning all the host bits must be
            /// zero or else the input is considered malformed. For example,
            /// `192.0.2.0/24` is accepted but `192.0.2.1/24` is not. Similarly, for
            /// IPv6, `2001:db8::/32` is accepted whereas `2001:db8::1/32` is not.
            pub allowed_ip_cidr_ranges: std::vec::Vec<std::string::String>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl VpcNetworkSource {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [network][crate::model::bucket::ip_filter::VpcNetworkSource::network].
            pub fn set_network<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<std::string::String>,
            {
                self.network = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [network][crate::model::bucket::ip_filter::VpcNetworkSource::network].
            pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<std::string::String>,
            {
                self.network = v.map(|x| x.into());
                self
            }

            /// Sets the value of [allowed_ip_cidr_ranges][crate::model::bucket::ip_filter::VpcNetworkSource::allowed_ip_cidr_ranges].
            pub fn set_allowed_ip_cidr_ranges<T, V>(mut self, v: T) -> Self
            where
                T: std::iter::IntoIterator<Item = V>,
                V: std::convert::Into<std::string::String>,
            {
                use std::iter::Iterator;
                self.allowed_ip_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
                self
            }
        }

        impl wkt::message::Message for VpcNetworkSource {
            fn typename() -> &'static str {
                "type.googleapis.com/google.storage.v2.Bucket.IpFilter.VpcNetworkSource"
            }
        }
    }

    /// Configuration for a bucket's hierarchical namespace feature.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct HierarchicalNamespace {
        /// Optional. Enables the hierarchical namespace feature.
        pub enabled: bool,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl HierarchicalNamespace {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [enabled][crate::model::bucket::HierarchicalNamespace::enabled].
        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.enabled = v.into();
            self
        }
    }

    impl wkt::message::Message for HierarchicalNamespace {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Bucket.HierarchicalNamespace"
        }
    }
}

/// An access-control entry.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BucketAccessControl {
    /// Optional. The access permission for the entity.
    pub role: std::string::String,

    /// Optional. The ID of the access-control entry.
    pub id: std::string::String,

    /// Optional. The entity holding the permission, in one of the following forms:
    ///
    /// * `user-{userid}`
    /// * `user-{email}`
    /// * `group-{groupid}`
    /// * `group-{email}`
    /// * `domain-{domain}`
    /// * `project-{team}-{projectnumber}`
    /// * `project-{team}-{projectid}`
    /// * `allUsers`
    /// * `allAuthenticatedUsers`
    ///   Examples:
    /// * The user `liz@example.com` would be `user-liz@example.com`.
    /// * The group `example@googlegroups.com` would be
    ///   `group-example@googlegroups.com`
    /// * All members of the Google Apps for Business domain `example.com` would be
    ///   `domain-example.com`
    ///   For project entities, `project-{team}-{projectnumber}` format is
    ///   returned on response.
    pub entity: std::string::String,

    /// Output only. The alternative entity format, if exists. For project
    /// entities, `project-{team}-{projectid}` format is returned in the response.
    pub entity_alt: std::string::String,

    /// Optional. The ID for the entity, if any.
    pub entity_id: std::string::String,

    /// Optional. The `etag` of the `BucketAccessControl`.
    /// If included in the metadata of an update or delete request message, the
    /// operation operation is only performed if the etag matches that of the
    /// bucket's `BucketAccessControl`.
    pub etag: std::string::String,

    /// Optional. The email address associated with the entity, if any.
    pub email: std::string::String,

    /// Optional. The domain associated with the entity, if any.
    pub domain: std::string::String,

    /// Optional. The project team associated with the entity, if any.
    pub project_team: std::option::Option<crate::model::ProjectTeam>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl BucketAccessControl {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [role][crate::model::BucketAccessControl::role].
    pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.role = v.into();
        self
    }

    /// Sets the value of [id][crate::model::BucketAccessControl::id].
    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.id = v.into();
        self
    }

    /// Sets the value of [entity][crate::model::BucketAccessControl::entity].
    pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.entity = v.into();
        self
    }

    /// Sets the value of [entity_alt][crate::model::BucketAccessControl::entity_alt].
    pub fn set_entity_alt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.entity_alt = v.into();
        self
    }

    /// Sets the value of [entity_id][crate::model::BucketAccessControl::entity_id].
    pub fn set_entity_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.entity_id = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::BucketAccessControl::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }

    /// Sets the value of [email][crate::model::BucketAccessControl::email].
    pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.email = v.into();
        self
    }

    /// Sets the value of [domain][crate::model::BucketAccessControl::domain].
    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.domain = v.into();
        self
    }

    /// Sets the value of [project_team][crate::model::BucketAccessControl::project_team].
    pub fn set_project_team<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ProjectTeam>,
    {
        self.project_team = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [project_team][crate::model::BucketAccessControl::project_team].
    pub fn set_or_clear_project_team<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ProjectTeam>,
    {
        self.project_team = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for BucketAccessControl {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.BucketAccessControl"
    }
}

/// Message used for storing full (not subrange) object checksums.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ObjectChecksums {
    /// CRC32C digest of the object data. Computed by the Cloud Storage service for
    /// all written objects.
    /// If set in a WriteObjectRequest, service validates that the stored
    /// object matches this checksum.
    pub crc32c: std::option::Option<u32>,

    /// Optional. 128 bit MD5 hash of the object data. For more information about
    /// using the MD5 hash, see [Data validation and change
    /// detection](https://cloud.google.com/storage/docs/data-validation). Not all
    /// objects provide an MD5 hash. For example, composite objects provide only
    /// crc32c hashes. This value is equivalent to running `cat object.txt |
    /// openssl md5 -binary`
    pub md5_hash: ::bytes::Bytes,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ObjectChecksums {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [crc32c][crate::model::ObjectChecksums::crc32c].
    pub fn set_crc32c<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<u32>,
    {
        self.crc32c = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [crc32c][crate::model::ObjectChecksums::crc32c].
    pub fn set_or_clear_crc32c<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<u32>,
    {
        self.crc32c = v.map(|x| x.into());
        self
    }

    /// Sets the value of [md5_hash][crate::model::ObjectChecksums::md5_hash].
    pub fn set_md5_hash<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.md5_hash = v.into();
        self
    }
}

impl wkt::message::Message for ObjectChecksums {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.ObjectChecksums"
    }
}

/// The payload of a single user-defined object context.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ObjectCustomContextPayload {
    /// Required. The value of the object context.
    pub value: std::string::String,

    /// Output only. The time at which the object context was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time at which the object context was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ObjectCustomContextPayload {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [value][crate::model::ObjectCustomContextPayload::value].
    pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.value = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::ObjectCustomContextPayload::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::ObjectCustomContextPayload::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::ObjectCustomContextPayload::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::ObjectCustomContextPayload::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ObjectCustomContextPayload {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.ObjectCustomContextPayload"
    }
}

/// All contexts of an object grouped by type.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ObjectContexts {
    /// Optional. User-defined object contexts.
    pub custom:
        std::collections::HashMap<std::string::String, crate::model::ObjectCustomContextPayload>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ObjectContexts {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [custom][crate::model::ObjectContexts::custom].
    pub fn set_custom<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::ObjectCustomContextPayload>,
    {
        use std::iter::Iterator;
        self.custom = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }
}

impl wkt::message::Message for ObjectContexts {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.ObjectContexts"
    }
}

/// Describes the customer-supplied encryption key mechanism used to store an
/// object's data at rest.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomerEncryption {
    /// Optional. The encryption algorithm.
    pub encryption_algorithm: std::string::String,

    /// Optional. SHA256 hash value of the encryption key.
    /// In raw bytes format (not base64-encoded).
    pub key_sha256_bytes: ::bytes::Bytes,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CustomerEncryption {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [encryption_algorithm][crate::model::CustomerEncryption::encryption_algorithm].
    pub fn set_encryption_algorithm<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.encryption_algorithm = v.into();
        self
    }

    /// Sets the value of [key_sha256_bytes][crate::model::CustomerEncryption::key_sha256_bytes].
    pub fn set_key_sha256_bytes<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.key_sha256_bytes = v.into();
        self
    }
}

impl wkt::message::Message for CustomerEncryption {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.CustomerEncryption"
    }
}

/// An object.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Object {
    /// Immutable. The name of this object. Nearly any sequence of unicode
    /// characters is valid. See
    /// [Guidelines](https://cloud.google.com/storage/docs/objects#naming).
    /// Example: `test.txt`
    /// The `name` field by itself does not uniquely identify a Cloud Storage
    /// object. A Cloud Storage object is uniquely identified by the tuple of
    /// (bucket, object, generation).
    pub name: std::string::String,

    /// Immutable. The name of the bucket containing this object.
    pub bucket: std::string::String,

    /// Optional. The `etag` of an object.
    /// If included in the metadata of an update or delete request message, the
    /// operation is only performed if the etag matches that of the live
    /// object.
    pub etag: std::string::String,

    /// Immutable. The content generation of this object. Used for object
    /// versioning.
    pub generation: i64,

    /// Output only. Restore token used to differentiate deleted objects with the
    /// same name and generation. This field is output only, and only set for
    /// deleted objects in HNS buckets.
    pub restore_token: std::option::Option<std::string::String>,

    /// Output only. The version of the metadata for this generation of this
    /// object. Used for preconditions and for detecting changes in metadata. A
    /// metageneration number is only meaningful in the context of a particular
    /// generation of a particular object.
    pub metageneration: i64,

    /// Optional. Storage class of the object.
    pub storage_class: std::string::String,

    /// Output only. Content-Length of the object data in bytes, matching
    /// [RFC 7230 §3.3.2](<https://tools.ietf.org/html/rfc7230#section-3.3.2>]).
    pub size: i64,

    /// Optional. Content-Encoding of the object data, matching
    /// [RFC 7231 §3.1.2.2](https://tools.ietf.org/html/rfc7231#section-3.1.2.2)
    pub content_encoding: std::string::String,

    /// Optional. Content-Disposition of the object data, matching
    /// [RFC 6266](https://tools.ietf.org/html/rfc6266).
    pub content_disposition: std::string::String,

    /// Optional. Cache-Control directive for the object data, matching
    /// [RFC 7234 §5.2](https://tools.ietf.org/html/rfc7234#section-5.2).
    /// If omitted, and the object is accessible to all anonymous users, the
    /// default is `public, max-age=3600`.
    pub cache_control: std::string::String,

    /// Optional. Access controls on the object.
    /// If `iam_config.uniform_bucket_level_access` is enabled on the parent
    /// bucket, requests to set, read, or modify acl is an error.
    pub acl: std::vec::Vec<crate::model::ObjectAccessControl>,

    /// Optional. Content-Language of the object data, matching
    /// [RFC 7231 §3.1.3.2](https://tools.ietf.org/html/rfc7231#section-3.1.3.2).
    pub content_language: std::string::String,

    /// Output only. If this object is noncurrent, this is the time when the object
    /// became noncurrent.
    pub delete_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the object was finalized.
    pub finalize_time: std::option::Option<wkt::Timestamp>,

    /// Optional. Content-Type of the object data, matching
    /// [RFC 7231 §3.1.1.5](https://tools.ietf.org/html/rfc7231#section-3.1.1.5).
    /// If an object is stored without a Content-Type, it is served as
    /// `application/octet-stream`.
    pub content_type: std::string::String,

    /// Output only. The creation time of the object.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Number of underlying components that make up this object.
    /// Components are accumulated by compose operations.
    pub component_count: i32,

    /// Output only. Hashes for the data part of this object. This field is used
    /// for output only and is silently ignored if provided in requests. The
    /// checksums of the complete object regardless of data range. If the object is
    /// downloaded in full, the client should compute one of these checksums over
    /// the downloaded object and compare it against the value provided here.
    pub checksums: std::option::Option<crate::model::ObjectChecksums>,

    /// Output only. The modification time of the object metadata.
    /// Set initially to object creation time and then updated whenever any
    /// metadata of the object changes. This includes changes made by a requester,
    /// such as modifying custom metadata, as well as changes made by Cloud Storage
    /// on behalf of a requester, such as changing the storage class based on an
    /// Object Lifecycle Configuration.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. Cloud KMS Key used to encrypt this object, if the object is
    /// encrypted by such a key.
    pub kms_key: std::string::String,

    /// Output only. The time at which the object's storage class was last changed.
    /// When the object is initially created, it is set to `time_created`.
    pub update_storage_class_time: std::option::Option<wkt::Timestamp>,

    /// Optional. Whether an object is under temporary hold. While this flag is set
    /// to true, the object is protected against deletion and overwrites.  A common
    /// use case of this flag is regulatory investigations where objects need to be
    /// retained while the investigation is ongoing. Note that unlike event-based
    /// hold, temporary hold does not impact retention expiration time of an
    /// object.
    pub temporary_hold: bool,

    /// Optional. A server-determined value that specifies the earliest time that
    /// the object's retention period expires. Note 1: This field is not provided
    /// for objects with an active event-based hold, since retention expiration is
    /// unknown until the hold is removed. Note 2: This value can be provided even
    /// when temporary hold is set (so that the user can reason about policy
    /// without having to first unset the temporary hold).
    pub retention_expire_time: std::option::Option<wkt::Timestamp>,

    /// Optional. User-provided metadata, in key/value pairs.
    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. User-defined or system-defined object contexts. Each object
    /// context is a key-payload pair, where the key provides the identification
    /// and the payload holds the associated value and additional metadata.
    pub contexts: std::option::Option<crate::model::ObjectContexts>,

    /// Whether an object is under event-based hold.
    /// An event-based hold is a way to force the retention of an object until
    /// after some event occurs. Once the hold is released by explicitly setting
    /// this field to `false`, the object becomes subject to any bucket-level
    /// retention policy, except that the retention duration is calculated
    /// from the time the event based hold was lifted, rather than the time the
    /// object was created.
    ///
    /// In a `WriteObject` request, not setting this field implies that the value
    /// should be taken from the parent bucket's `default_event_based_hold` field.
    /// In a response, this field is always set to `true` or `false`.
    pub event_based_hold: std::option::Option<bool>,

    /// Output only. The owner of the object. This is always the uploader of the
    /// object.
    pub owner: std::option::Option<crate::model::Owner>,

    /// Optional. Metadata of customer-supplied encryption key, if the object is
    /// encrypted by such a key.
    pub customer_encryption: std::option::Option<crate::model::CustomerEncryption>,

    /// Optional. A user-specified timestamp set on an object.
    pub custom_time: std::option::Option<wkt::Timestamp>,

    /// Output only. This is the time when the object became soft-deleted.
    ///
    /// Soft-deleted objects are only accessible if a soft_delete_policy is
    /// enabled. Also see `hard_delete_time`.
    pub soft_delete_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time when the object is permanently deleted.
    ///
    /// Only set when an object becomes soft-deleted with a `soft_delete_policy`.
    /// Otherwise, the object is not accessible.
    pub hard_delete_time: std::option::Option<wkt::Timestamp>,

    /// Optional. Retention configuration of this object.
    /// Might only be configured if the bucket has object retention enabled.
    pub retention: std::option::Option<crate::model::object::Retention>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Object {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Object::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [bucket][crate::model::Object::bucket].
    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.bucket = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::Object::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }

    /// Sets the value of [generation][crate::model::Object::generation].
    pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.generation = v.into();
        self
    }

    /// Sets the value of [restore_token][crate::model::Object::restore_token].
    pub fn set_restore_token<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.restore_token = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [restore_token][crate::model::Object::restore_token].
    pub fn set_or_clear_restore_token<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.restore_token = v.map(|x| x.into());
        self
    }

    /// Sets the value of [metageneration][crate::model::Object::metageneration].
    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.metageneration = v.into();
        self
    }

    /// Sets the value of [storage_class][crate::model::Object::storage_class].
    pub fn set_storage_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.storage_class = v.into();
        self
    }

    /// Sets the value of [size][crate::model::Object::size].
    pub fn set_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.size = v.into();
        self
    }

    /// Sets the value of [content_encoding][crate::model::Object::content_encoding].
    pub fn set_content_encoding<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.content_encoding = v.into();
        self
    }

    /// Sets the value of [content_disposition][crate::model::Object::content_disposition].
    pub fn set_content_disposition<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.content_disposition = v.into();
        self
    }

    /// Sets the value of [cache_control][crate::model::Object::cache_control].
    pub fn set_cache_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.cache_control = v.into();
        self
    }

    /// Sets the value of [acl][crate::model::Object::acl].
    pub fn set_acl<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ObjectAccessControl>,
    {
        use std::iter::Iterator;
        self.acl = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [content_language][crate::model::Object::content_language].
    pub fn set_content_language<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.content_language = v.into();
        self
    }

    /// Sets the value of [delete_time][crate::model::Object::delete_time].
    pub fn set_delete_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.delete_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [delete_time][crate::model::Object::delete_time].
    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.delete_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [finalize_time][crate::model::Object::finalize_time].
    pub fn set_finalize_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.finalize_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [finalize_time][crate::model::Object::finalize_time].
    pub fn set_or_clear_finalize_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.finalize_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [content_type][crate::model::Object::content_type].
    pub fn set_content_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.content_type = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Object::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Object::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [component_count][crate::model::Object::component_count].
    pub fn set_component_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.component_count = v.into();
        self
    }

    /// Sets the value of [checksums][crate::model::Object::checksums].
    pub fn set_checksums<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ObjectChecksums>,
    {
        self.checksums = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [checksums][crate::model::Object::checksums].
    pub fn set_or_clear_checksums<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ObjectChecksums>,
    {
        self.checksums = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Object::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Object::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [kms_key][crate::model::Object::kms_key].
    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.kms_key = v.into();
        self
    }

    /// Sets the value of [update_storage_class_time][crate::model::Object::update_storage_class_time].
    pub fn set_update_storage_class_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_storage_class_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_storage_class_time][crate::model::Object::update_storage_class_time].
    pub fn set_or_clear_update_storage_class_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_storage_class_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [temporary_hold][crate::model::Object::temporary_hold].
    pub fn set_temporary_hold<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.temporary_hold = v.into();
        self
    }

    /// Sets the value of [retention_expire_time][crate::model::Object::retention_expire_time].
    pub fn set_retention_expire_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.retention_expire_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [retention_expire_time][crate::model::Object::retention_expire_time].
    pub fn set_or_clear_retention_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.retention_expire_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [metadata][crate::model::Object::metadata].
    pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [contexts][crate::model::Object::contexts].
    pub fn set_contexts<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ObjectContexts>,
    {
        self.contexts = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [contexts][crate::model::Object::contexts].
    pub fn set_or_clear_contexts<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ObjectContexts>,
    {
        self.contexts = v.map(|x| x.into());
        self
    }

    /// Sets the value of [event_based_hold][crate::model::Object::event_based_hold].
    pub fn set_event_based_hold<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<bool>,
    {
        self.event_based_hold = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [event_based_hold][crate::model::Object::event_based_hold].
    pub fn set_or_clear_event_based_hold<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<bool>,
    {
        self.event_based_hold = v.map(|x| x.into());
        self
    }

    /// Sets the value of [owner][crate::model::Object::owner].
    pub fn set_owner<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Owner>,
    {
        self.owner = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [owner][crate::model::Object::owner].
    pub fn set_or_clear_owner<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Owner>,
    {
        self.owner = v.map(|x| x.into());
        self
    }

    /// Sets the value of [customer_encryption][crate::model::Object::customer_encryption].
    pub fn set_customer_encryption<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CustomerEncryption>,
    {
        self.customer_encryption = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [customer_encryption][crate::model::Object::customer_encryption].
    pub fn set_or_clear_customer_encryption<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CustomerEncryption>,
    {
        self.customer_encryption = v.map(|x| x.into());
        self
    }

    /// Sets the value of [custom_time][crate::model::Object::custom_time].
    pub fn set_custom_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.custom_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [custom_time][crate::model::Object::custom_time].
    pub fn set_or_clear_custom_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.custom_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [soft_delete_time][crate::model::Object::soft_delete_time].
    pub fn set_soft_delete_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.soft_delete_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [soft_delete_time][crate::model::Object::soft_delete_time].
    pub fn set_or_clear_soft_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.soft_delete_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [hard_delete_time][crate::model::Object::hard_delete_time].
    pub fn set_hard_delete_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.hard_delete_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [hard_delete_time][crate::model::Object::hard_delete_time].
    pub fn set_or_clear_hard_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.hard_delete_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [retention][crate::model::Object::retention].
    pub fn set_retention<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::object::Retention>,
    {
        self.retention = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [retention][crate::model::Object::retention].
    pub fn set_or_clear_retention<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::object::Retention>,
    {
        self.retention = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Object {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.Object"
    }
}

/// Defines additional types related to [Object].
pub mod object {
    #[allow(unused_imports)]
    use super::*;

    /// Specifies retention parameters of the object. Objects under retention
    /// cannot be deleted or overwritten until their retention expires.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Retention {
        /// Optional. The mode of the Retention.
        pub mode: crate::model::object::retention::Mode,

        /// Optional. The timestamp that the object needs to be retained until.
        /// Value cannot be set in the past or more than 100 years in the future.
        pub retain_until_time: std::option::Option<wkt::Timestamp>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Retention {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [mode][crate::model::object::Retention::mode].
        pub fn set_mode<T: std::convert::Into<crate::model::object::retention::Mode>>(
            mut self,
            v: T,
        ) -> Self {
            self.mode = v.into();
            self
        }

        /// Sets the value of [retain_until_time][crate::model::object::Retention::retain_until_time].
        pub fn set_retain_until_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.retain_until_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [retain_until_time][crate::model::object::Retention::retain_until_time].
        pub fn set_or_clear_retain_until_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.retain_until_time = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for Retention {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.v2.Object.Retention"
        }
    }

    /// Defines additional types related to [Retention].
    pub mod retention {
        #[allow(unused_imports)]
        use super::*;

        /// Retention mode values.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Mode {
            /// No specified mode. Object is not under retention.
            Unspecified,
            /// Retention period might be decreased or increased.
            /// The Retention configuration might be removed.
            /// The mode might be changed to locked.
            Unlocked,
            /// Retention period might be increased.
            /// The Retention configuration cannot be removed.
            /// The mode cannot be changed.
            Locked,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [Mode::value] or
            /// [Mode::name].
            UnknownValue(mode::UnknownValue),
        }

        #[doc(hidden)]
        pub mod mode {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl Mode {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Unlocked => std::option::Option::Some(1),
                    Self::Locked => std::option::Option::Some(2),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
                    Self::Unlocked => std::option::Option::Some("UNLOCKED"),
                    Self::Locked => std::option::Option::Some("LOCKED"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for Mode {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for Mode {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for Mode {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Unlocked,
                    2 => Self::Locked,
                    _ => Self::UnknownValue(mode::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for Mode {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "MODE_UNSPECIFIED" => Self::Unspecified,
                    "UNLOCKED" => Self::Unlocked,
                    "LOCKED" => Self::Locked,
                    _ => Self::UnknownValue(mode::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for Mode {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Unlocked => serializer.serialize_i32(1),
                    Self::Locked => serializer.serialize_i32(2),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for Mode {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
                    ".google.storage.v2.Object.Retention.Mode",
                ))
            }
        }
    }
}

/// An access-control entry.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ObjectAccessControl {
    /// Optional. The access permission for the entity. One of the following
    /// values:
    ///
    /// * `READER`
    /// * `WRITER`
    /// * `OWNER`
    pub role: std::string::String,

    /// Optional. The ID of the access-control entry.
    pub id: std::string::String,

    /// Optional. The entity holding the permission, in one of the following forms:
    ///
    /// * `user-{userid}`
    /// * `user-{email}`
    /// * `group-{groupid}`
    /// * `group-{email}`
    /// * `domain-{domain}`
    /// * `project-{team}-{projectnumber}`
    /// * `project-{team}-{projectid}`
    /// * `allUsers`
    /// * `allAuthenticatedUsers`
    ///   Examples:
    /// * The user `liz@example.com` would be `user-liz@example.com`.
    /// * The group `example@googlegroups.com` would be
    ///   `group-example@googlegroups.com`.
    /// * All members of the Google Apps for Business domain `example.com` would be
    ///   `domain-example.com`.
    ///   For project entities, `project-{team}-{projectnumber}` format is
    ///   returned in the response.
    pub entity: std::string::String,

    /// Output only. The alternative entity format, if exists. For project
    /// entities, `project-{team}-{projectid}` format is returned in the response.
    pub entity_alt: std::string::String,

    /// Optional. The ID for the entity, if any.
    pub entity_id: std::string::String,

    /// Optional. The etag of the ObjectAccessControl.
    /// If included in the metadata of an update or delete request message, the
    /// operation is only performed if the etag matches that of the live
    /// object's ObjectAccessControl.
    pub etag: std::string::String,

    /// Optional. The email address associated with the entity, if any.
    pub email: std::string::String,

    /// Optional. The domain associated with the entity, if any.
    pub domain: std::string::String,

    /// Optional. The project team associated with the entity, if any.
    pub project_team: std::option::Option<crate::model::ProjectTeam>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ObjectAccessControl {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [role][crate::model::ObjectAccessControl::role].
    pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.role = v.into();
        self
    }

    /// Sets the value of [id][crate::model::ObjectAccessControl::id].
    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.id = v.into();
        self
    }

    /// Sets the value of [entity][crate::model::ObjectAccessControl::entity].
    pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.entity = v.into();
        self
    }

    /// Sets the value of [entity_alt][crate::model::ObjectAccessControl::entity_alt].
    pub fn set_entity_alt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.entity_alt = v.into();
        self
    }

    /// Sets the value of [entity_id][crate::model::ObjectAccessControl::entity_id].
    pub fn set_entity_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.entity_id = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::ObjectAccessControl::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }

    /// Sets the value of [email][crate::model::ObjectAccessControl::email].
    pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.email = v.into();
        self
    }

    /// Sets the value of [domain][crate::model::ObjectAccessControl::domain].
    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.domain = v.into();
        self
    }

    /// Sets the value of [project_team][crate::model::ObjectAccessControl::project_team].
    pub fn set_project_team<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ProjectTeam>,
    {
        self.project_team = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [project_team][crate::model::ObjectAccessControl::project_team].
    pub fn set_or_clear_project_team<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ProjectTeam>,
    {
        self.project_team = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ObjectAccessControl {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.ObjectAccessControl"
    }
}

/// The result of a call to Objects.ListObjects
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListObjectsResponse {
    /// The list of items.
    pub objects: std::vec::Vec<crate::model::Object>,

    /// The list of prefixes of objects matching-but-not-listed up to and including
    /// the requested delimiter.
    pub prefixes: std::vec::Vec<std::string::String>,

    /// The continuation token, used to page through large result sets. Provide
    /// this value in a subsequent request to return the next page of results.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListObjectsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [objects][crate::model::ListObjectsResponse::objects].
    pub fn set_objects<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Object>,
    {
        use std::iter::Iterator;
        self.objects = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [prefixes][crate::model::ListObjectsResponse::prefixes].
    pub fn set_prefixes<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.prefixes = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListObjectsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListObjectsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.ListObjectsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListObjectsResponse {
    type PageItem = crate::model::Object;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.objects
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Represents the Viewers, Editors, or Owners of a given project.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ProjectTeam {
    /// Optional. The project number.
    pub project_number: std::string::String,

    /// Optional. The team.
    pub team: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ProjectTeam {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [project_number][crate::model::ProjectTeam::project_number].
    pub fn set_project_number<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.project_number = v.into();
        self
    }

    /// Sets the value of [team][crate::model::ProjectTeam::team].
    pub fn set_team<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.team = v.into();
        self
    }
}

impl wkt::message::Message for ProjectTeam {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.ProjectTeam"
    }
}

/// The owner of a specific resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Owner {
    /// Optional. The entity, in the form `user-`*userId*.
    pub entity: std::string::String,

    /// Optional. The ID for the entity.
    pub entity_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Owner {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [entity][crate::model::Owner::entity].
    pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.entity = v.into();
        self
    }

    /// Sets the value of [entity_id][crate::model::Owner::entity_id].
    pub fn set_entity_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.entity_id = v.into();
        self
    }
}

impl wkt::message::Message for Owner {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.v2.Owner"
    }
}
